mirror of https://github.com/AxioDL/boo.git
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:
parent
c33604b8cb
commit
ff0b3eb2b1
|
@ -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; \
|
||||
|
|
Loading…
Reference in New Issue