mirror of
https://github.com/libAthena/athena.git
synced 2025-12-08 13:15:05 +00:00
Global: Make operator|= and &= for enums constexpr
These are allowed to be constexpr since C++14
This commit is contained in:
@@ -95,12 +95,12 @@ typedef struct stat64 atStat64_t;
|
||||
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; \
|
||||
|
||||
Reference in New Issue
Block a user