Go to the documentation of this file.
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>
41 friend struct std::hash<
FlagSet<E,N>>;
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< E, N > operator^(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
bool any() const noexcept
FlagSet< E, N > operator|(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
reference operator[](E tag)
FlagSet operator~() const noexcept
FlagSet & operator&=(const FlagSet &o) noexcept
bool none() const noexcept
FlagSet & operator^=(const FlagSet &o) noexcept
std::bitset< N > underlying
FlagSet & operator|=(const FlagSet &o) noexcept
friend bool operator==(const FlagSet< EE, NN > &l, const FlagSet< EE, NN > &r)
size_t operator()(const FlagSet< E, N > &fs)
bool operator!=(const FlagSet< E, N > &l, const FlagSet< E, N > &r)
constexpr bool operator[](E tag) const
typename underlying::reference reference
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)
constexpr FlagSet()=default