| 1015 | return static_cast<T>(static_cast<U>(a) & static_cast<U>(b)); |
| 1016 | } |
| 1017 | template<class T> constexpr T enum_bit_xor(T a, T b) noexcept |
| 1018 | { |
| 1019 | static_assert(std::is_enum<T>::value, "must be enum"); |
| 1020 | using U = typename std::underlying_type<T>::type; |
| 1021 | return static_cast<T>(static_cast<U>(a) ^ static_cast<U>(b)); |
| 1022 | } |
| 1023 | template<class T> constexpr T enum_bit_not(T a) noexcept |
| 1024 | { |
| 1025 | static_assert(std::is_enum<T>::value, "must be enum"); |