mirror of
https://github.com/libAthena/athena.git
synced 2025-07-12 16:16:01 +00:00
Global: Make operator|= and &= for enums constexpr
These are allowed to be constexpr since C++14
This commit is contained in:
parent
30158859f7
commit
b629d90147
@ -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; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user