mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-11 14:40:46 +01:00
operator>> for serialisable enums
This commit is contained in:
parent
d775fbb2f9
commit
e7d8030a64
@ -189,6 +189,15 @@ public:\
|
|||||||
}\
|
}\
|
||||||
return os;\
|
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:\
|
private:\
|
||||||
int value_;\
|
int value_;\
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user