1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

operator>> for serialisable enums

This commit is contained in:
Antonin Portelli 2017-02-01 15:51:08 -08:00
parent d775fbb2f9
commit e7d8030a64

View File

@ -189,6 +189,15 @@ public:\
}\
return os;\
}\
inline friend std::istream & operator>>(std::istream &is, name &obj)\
{\
std::string buf;\
is >> buf;\
if (buf == #undefname) {obj = name::undefname;}\
GRID_MACRO_EVAL(GRID_MACRO_MAP(GRID_MACRO_ENUMTEST,__VA_ARGS__))\
else {obj = name::undefname;}\
return is;\
}\
private:\
int value_;\
};