3 #if __cplusplus < 201103L
4 #error "strongenumflag is only supported with c++11 or newer"
9 #ifndef WIBBLE_STRONGENUMFLAG_H
10 #define WIBBLE_STRONGENUMFLAG_H
14 template<
typename E >
16 std::is_enum< E >::value && !std::is_convertible< E, int >::value >;
18 template<
typename Self >
26 store( static_cast< UnderlyingType >( flag ) )
45 return This( a.store | b.store );
49 return This( a.store & b.store );
53 return a.store == b.store;
57 return a.store != b.store;
60 constexpr
bool has( Self x )
const noexcept {
64 constexpr
operator bool() const noexcept {
73 template<
typename Self,
typename =
typename
74 std::enable_if< is_enum_class< Self >::value >::type >
77 return Ret( a ) | Ret( b );
80 template<
typename Self,
typename =
typename
81 std::enable_if< is_enum_class< Self >::value >::type >
84 return Ret( a ) & Ret( b );
89 #endif // WIBBLE_STRONGENUMFLAG_H