Add stream output operator for enums
This commit is contained in:
parent
66deca8cda
commit
754566ec15
1 changed files with 2 additions and 0 deletions
|
|
@ -90,6 +90,8 @@ namespace psemek::util
|
|||
}; \
|
||||
auto it = map.find(str); if (it == map.end()) return std::nullopt; return it->second; \
|
||||
} \
|
||||
template <typename Char, typename Traits> \
|
||||
inline ::std::basic_ostream<Char, Traits> & operator << (::std::basic_ostream<Char, Traits> & os, name value) { return os << to_string(value); } \
|
||||
inline ::psemek::util::enum_range<name> BOOST_PP_CAT(name, _values) () { return {0, BOOST_PP_SEQ_SIZE(values)}; }
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue