| 52 | static_assert(size_ <= (sizeof(S) * 8), "BitSet has too many elements for storage type"); |
| 53 | |
| 54 | class BitRef |
| 55 | { |
| 56 | public: |
| 57 | operator bool() const |
| 58 | { |
| 59 | return bitset.test(e); |
| 60 | } |
| 61 | |
| 62 | BitRef& operator=(bool b) |
| 63 | { |
| 64 | bitset.set(e, b); |
| 65 | return *this; |
| 66 | } |
| 67 | |
| 68 | private: |
| 69 | friend BitSet; |
| 70 | BitRef(BitSet& bitset, E e) : bitset(bitset), e(e) |
| 71 | { |
| 72 | } |
| 73 | |
| 74 | BitSet& bitset; |
| 75 | E e; |
| 76 | }; |
| 77 | |
| 78 | /** |
| 79 | * @brief Construct empty set |