From 1b813f0c701c4e30e2cd5a29a42860aa6eb31369 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 5 Apr 2020 10:00:09 -0400 Subject: [PATCH] Util: Make operator|= and &= constexpr for bitwise enums Maintains parity with hecl's version of the macro, etc. --- include/kabufuda/Util.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kabufuda/Util.hpp b/include/kabufuda/Util.hpp index 5f731dd..34a1268 100644 --- a/include/kabufuda/Util.hpp +++ b/include/kabufuda/Util.hpp @@ -48,12 +48,12 @@ using T = std::underlying_type_t; \ return type(static_cast(a) & static_cast(b)); \ } \ - inline type& operator|=(type& a, const type& b) { \ + constexpr type& operator|=(type& a, type b) { \ using T = std::underlying_type_t; \ a = type(static_cast(a) | static_cast(b)); \ return a; \ } \ - inline type& operator&=(type& a, const type& b) { \ + constexpr type& operator&=(type& a, type b) { \ using T = std::underlying_type_t; \ a = type(static_cast(a) & static_cast(b)); \ return a; \