From ff0b3eb2b144ab397976d89252f313f074de9755 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 17 Aug 2019 20:36:39 -0400 Subject: [PATCH] System: Make operator|= and operator&= for enums constexpr It's valid to allow these to be used within a constexpr context. Makes the enum functions more consistent. --- include/boo/System.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boo/System.hpp b/include/boo/System.hpp index 822d738..8495500 100644 --- a/include/boo/System.hpp +++ b/include/boo/System.hpp @@ -37,12 +37,12 @@ static inline ComPtr* ReferenceComPtr(ComPtr& ptr) { 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, const 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, const type& b) { \ using T = std::underlying_type_t; \ a = type(static_cast(a) & static_cast(b)); \ return a; \