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

It's valid to allow these to be used within a constexpr context. Makes
the enum functions more consistent.
This commit is contained in:
Lioncash 2019-08-17 20:36:39 -04:00
parent c33604b8cb
commit ff0b3eb2b1
1 changed files with 2 additions and 2 deletions

View File

@ -37,12 +37,12 @@ static inline ComPtr<T>* ReferenceComPtr(ComPtr<T>& ptr) {
using T = std::underlying_type_t<type>; \
return type(static_cast<T>(a) & static_cast<T>(b)); \
} \
inline type& operator|=(type& a, const type& b) { \
constexpr type& operator|=(type& a, const type& b) { \
using T = std::underlying_type_t<type>; \
a = type(static_cast<T>(a) | static_cast<T>(b)); \
return a; \
} \
inline type& operator&=(type& a, const type& b) { \
constexpr type& operator&=(type& a, const type& b) { \
using T = std::underlying_type_t<type>; \
a = type(static_cast<T>(a) & static_cast<T>(b)); \
return a; \