Browse Source

Added (explicit) operator bool to Set.

So things like if(!(set & Enum::Value)) are possible.
vectorfields
Vladimír Vondruš 14 years ago
parent
commit
daaf89a1a1
  1. 5
      src/Set.h

5
src/Set.h

@ -81,6 +81,11 @@ template<class T, class U> class Set {
return Set<T, U>(~value); return Set<T, U>(~value);
} }
/** @brief Value as boolean */
inline constexpr explicit operator bool() const {
return value == 0;
}
/** @brief Value in underlying type */ /** @brief Value in underlying type */
inline constexpr explicit operator UnderlyingType() const { inline constexpr explicit operator UnderlyingType() const {
return value; return value;

Loading…
Cancel
Save