mirror of
https://github.com/encounter/aurora.git
synced 2025-07-04 20:26:07 +00:00
Util: Make operator|= and &= constexpr for bitwise enums
Maintains parity with hecl's version of the macro, etc.
This commit is contained in:
parent
2b1bfa0422
commit
6401b0baea
@ -48,12 +48,12 @@
|
||||
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, 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, type b) { \
|
||||
using T = std::underlying_type_t<type>; \
|
||||
a = type(static_cast<T>(a) & static_cast<T>(b)); \
|
||||
return a; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user