From 74ce228b1e3e756174c2e75579bfe500701ee570 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 20 Jun 2019 18:44:26 +0200 Subject: compat: sprinkle constexpr --- compat/enum-operators.hpp | 6 +++--- 1 file 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 #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; \ 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; \ 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; \ lhs = type(t_((lhs)) op t_((rhs))); \ -- cgit v1.2.3