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:
parent
d775fbb2f9
commit
e7d8030a64
@ -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_;\
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user