We already know the underlying_type.

We just need to pass it to DEFINE_BITMASK_OPERATORS macro
This commit is contained in:
BogDan Vatra
2016-06-01 10:04:55 +03:00
parent 7d1f372ba6
commit 0b0cf58f24
2 changed files with 2 additions and 6 deletions

View File

@@ -1485,21 +1485,17 @@ volatile __attribute__((weak)) const char *flatbuffer_version_string =
#endif // !defined(_WIN32) && !defined(__CYGWIN__)
#define DEFINE_BITMASK_OPERATORS(E)\
#define DEFINE_BITMASK_OPERATORS(E, T)\
inline E operator | (E lhs, E rhs){\
using T = std::underlying_type<E>::type;\
return E(T(lhs) | T(rhs));\
}\
inline E operator & (E lhs, E rhs){\
using T = std::underlying_type<E>::type;\
return E(T(lhs) & T(rhs));\
}\
inline E operator ^ (E lhs, E rhs){\
using T = std::underlying_type<E>::type;\
return E(T(lhs) ^ T(rhs));\
}\
inline E operator ~ (E lhs){\
using T = std::underlying_type<E>::type;\
return E(~T(lhs));\
}\
inline E operator |= (E &lhs, E rhs){\