mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Make use of constexpr in the ENUM_CLASS_BITOPS macro
This commit is contained in:
1 parent
0332e67ad4
commit
2086326c75
1 file changed
+3
-3
+3
-3
@@ -38,21 +38,21 @@
|
||||
|
||||
#ifndef ENUM_CLASS_BITOPS
|
||||
#define ENUM_CLASS_BITOPS(T) \
|
||||
static inline T operator |(const T &lhs, const T &rhs) { \
|
||||
static inline constexpr T operator |(const T &lhs, const T &rhs) { \
|
||||
return T((int)lhs | (int)rhs); \
|
||||
} \
|
||||
static inline T &operator |= (T &lhs, const T &rhs) { \
|
||||
lhs = lhs | rhs; \
|
||||
return lhs; \
|
||||
} \
|
||||
static inline bool operator &(const T &lhs, const T &rhs) { \
|
||||
static inline constexpr bool operator &(const T &lhs, const T &rhs) { \
|
||||
return ((int)lhs & (int)rhs) != 0; \
|
||||
} \
|
||||
static inline T &operator &= (T &lhs, const T &rhs) { \
|
||||
lhs = (T)((int)lhs & (int)rhs); \
|
||||
return lhs; \
|
||||
} \
|
||||
static inline T operator ~(const T &rhs) { \
|
||||
static inline constexpr T operator ~(const T &rhs) { \
|
||||
return (T)(~((int)rhs)); \
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user