summaryrefslogtreecommitdiff
path: root/src/common/common_funcs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/common_funcs.h')
-rw-r--r--src/common/common_funcs.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 98421bced..367b6bf6e 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -64,14 +64,20 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
64 using T = std::underlying_type_t<type>; \ 64 using T = std::underlying_type_t<type>; \
65 return static_cast<type>(static_cast<T>(a) & static_cast<T>(b)); \ 65 return static_cast<type>(static_cast<T>(a) & static_cast<T>(b)); \
66 } \ 66 } \
67 constexpr type& operator|=(type& a, type b) noexcept { \ 67 [[nodiscard]] constexpr type operator^(type a, type b) noexcept { \
68 using T = std::underlying_type_t<type>; \ 68 using T = std::underlying_type_t<type>; \
69 a = static_cast<type>(static_cast<T>(a) | static_cast<T>(b)); \ 69 return static_cast<type>(static_cast<T>(a) ^ static_cast<T>(b)); \
70 } \
71 constexpr type& operator|=(type& a, type b) noexcept { \
72 a = a | b; \
70 return a; \ 73 return a; \
71 } \ 74 } \
72 constexpr type& operator&=(type& a, type b) noexcept { \ 75 constexpr type& operator&=(type& a, type b) noexcept { \
73 using T = std::underlying_type_t<type>; \ 76 a = a & b; \
74 a = static_cast<type>(static_cast<T>(a) & static_cast<T>(b)); \ 77 return a; \
78 } \
79 constexpr type& operator^=(type& a, type b) noexcept { \
80 a = a ^ b; \
75 return a; \ 81 return a; \
76 } \ 82 } \
77 [[nodiscard]] constexpr type operator~(type key) noexcept { \ 83 [[nodiscard]] constexpr type operator~(type key) noexcept { \