Global: Make operator|= and &= for enums constexpr

These are allowed to be constexpr since C++14
This commit is contained in:
Lioncash 2019-09-07 12:36:56 -04:00
parent 30158859f7
commit b629d90147

View File

@ -95,12 +95,12 @@ typedef struct stat64 atStat64_t;
using T = std::underlying_type_t<type>; \ using T = std::underlying_type_t<type>; \
return type(static_cast<T>(a) & static_cast<T>(b)); \ return type(static_cast<T>(a) & static_cast<T>(b)); \
} \ } \
inline type& operator|=(type& a, const type& b) { \ constexpr type& operator|=(type& a, type b) { \
using T = std::underlying_type_t<type>; \ using T = std::underlying_type_t<type>; \
a = type(static_cast<T>(a) | static_cast<T>(b)); \ a = type(static_cast<T>(a) | static_cast<T>(b)); \
return a; \ return a; \
} \ } \
inline type& operator&=(type& a, const type& b) { \ constexpr type& operator&=(type& a, type b) { \
using T = std::underlying_type_t<type>; \ using T = std::underlying_type_t<type>; \
a = type(static_cast<T>(a) & static_cast<T>(b)); \ a = type(static_cast<T>(a) & static_cast<T>(b)); \
return a; \ return a; \