diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-06-20 18:44:26 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-06-20 18:44:26 +0200 |
commit | 74ce228b1e3e756174c2e75579bfe500701ee570 (patch) | |
tree | fbfa051d259d51fed94c91c11d793786699ca6da /compat | |
parent | 9b2df9f1c597ed531f5b675ae32eec6fe515e4a6 (diff) |
compat: sprinkle constexpr
Diffstat (limited to 'compat')
-rw-r--r-- | compat/enum-operators.hpp | 6 |
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))); \ |