summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--compat/enum-operators.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/compat/enum-operators.hpp b/compat/enum-operators.hpp
index 188a081d..e4f81a39 100644
--- a/compat/enum-operators.hpp
+++ b/compat/enum-operators.hpp
@@ -3,7 +3,7 @@
#include <type_traits>
#define OTR_FLAGS_OP2(type, op) \
- inline type operator op (type a, type b) \
+ constexpr inline type operator op (type a, type b) \
{ \
using t_ = std::underlying_type_t<type>; \
return type(t_((a)) op t_((b))); \
@@ -14,14 +14,14 @@
type operator op (type, u) = delete // end
#define OTR_FLAGS_OP1(type, op) \
- inline type operator op (type x) \
+ constexpr inline type operator op (type x) \
{ \
using t_ = std::underlying_type_t<type>; \
return type(op t_((x))); \
} // end
#define OTR_FLAGS_ASSIGN_OP(type, op) \
- inline type& operator op ## = (type& lhs, type rhs) \
+ constexpr inline type& operator op ## = (type& lhs, type rhs) \
{ \
using t_ = std::underlying_type_t<decltype(rhs)>; \
lhs = type(t_((lhs)) op t_((rhs))); \