From 660df8f7e614fa32b54e9fe146a492ce159ded31 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 9 Sep 2019 21:00:41 -0400 Subject: [PATCH] System: Make enum functions noexcept Allows them to be used within noexcept contexts --- include/boo/System.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boo/System.hpp b/include/boo/System.hpp index 509bec2..15cfe4f 100644 --- a/include/boo/System.hpp +++ b/include/boo/System.hpp @@ -29,33 +29,33 @@ static inline ComPtr* ReferenceComPtr(ComPtr& ptr) { #ifndef ENABLE_BITWISE_ENUM #define ENABLE_BITWISE_ENUM(type) \ - constexpr type operator|(type a, type b) { \ + constexpr type operator|(type a, type b) noexcept { \ using T = std::underlying_type_t; \ return type(static_cast(a) | static_cast(b)); \ } \ - constexpr type operator&(type a, type b) { \ + constexpr type operator&(type a, type b) noexcept { \ using T = std::underlying_type_t; \ return type(static_cast(a) & static_cast(b)); \ } \ - constexpr type& operator|=(type& a, type b) { \ + constexpr type& operator|=(type& a, type b) noexcept { \ using T = std::underlying_type_t; \ a = type(static_cast(a) | static_cast(b)); \ return a; \ } \ - constexpr type& operator&=(type& a, type b) { \ + constexpr type& operator&=(type& a, type b) noexcept { \ using T = std::underlying_type_t; \ a = type(static_cast(a) & static_cast(b)); \ return a; \ } \ - constexpr type operator~(type key) { \ + constexpr type operator~(type key) noexcept { \ using T = std::underlying_type_t; \ return type(~static_cast(key)); \ } \ - constexpr bool True(type key) { \ + constexpr bool True(type key) noexcept { \ using T = std::underlying_type_t; \ return static_cast(key) != 0; \ } \ - constexpr bool False(type key) { \ + constexpr bool False(type key) noexcept { \ using T = std::underlying_type_t; \ return static_cast(key) == 0; \ }