10 #ifndef LCF_FLAG_SET_H 11 #define LCF_FLAG_SET_H 15 template <
typename E,
size_t N=32>
22 FlagSet(std::initializer_list<E> ilist);
28 bool any() const noexcept {
return _bits.any(); }
38 template <
typename EE,
size_t NN>
46 template <
typename E,
size_t N>
51 template <
typename E,
size_t N>
56 template <
typename E,
size_t N>
63 template <
typename E,
size_t N>
70 template <
typename E,
size_t N>
77 template <
typename E,
size_t N>
79 for (
auto&& tag: ilist) {
80 _bits.set(static_cast<size_t>(tag));
85 template <
typename E,
size_t N>
88 return hash<typename FlagSet<E,N>::underlying>()(fs.
_bits);
FlagSet & operator^=(const FlagSet &o) noexcept
FlagSet< E, N > operator^(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
bool any() const noexcept
constexpr FlagSet()=default
size_t operator()(const FlagSet< E, N > &fs)
FlagSet operator~() const noexcept
std::bitset< N > underlying
friend bool operator==(const FlagSet< EE, NN > &l, const FlagSet< EE, NN > &r)
constexpr bool operator[](E tag) const
FlagSet & operator&=(const FlagSet &o) noexcept
FlagSet & operator|=(const FlagSet &o) noexcept
bool none() const noexcept
bool operator!=(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
reference operator[](E tag)
bool operator==(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
FlagSet< E, N > operator|(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
FlagSet< E, N > operator&(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
typename underlying::reference reference