13 template <
int N,
typename T>
19 template <
int N,
typename T>
23 "Attempted to remove a value that is outside the scope of the BitSet");
24 const int byte =
value / BIT_SIZE;
32 template <
int N,
typename T>
35 PONCA_ASSERT_MSG(
value >= 0 &&
value <
N,
"Inserted value is outside the scope of the BitSet");
36 const int byte =
value / BIT_SIZE;
44 template <
int N,
typename T>
47 PONCA_ASSERT_MSG(
value >= 0 &&
value <
N,
"Searched value is outside the scope of the BitSet");
48 const int byte =
value / BIT_SIZE;
50 return (m_data[
byte] & (T(1) <<
bit)) != 0;
56 template <
int N,
typename T>
59 PONCA_ASSERT_MSG(
i >= 0 &&
i <
N,
"Flipped value is outside the scope of the BitSet");
60 const int byte =
i / BIT_SIZE;
61 const int bit =
i % BIT_SIZE;
Aggregator class used to declare specialized structures using CRTP.
bool insert(int value)
Tries to insert a value in the set.
void clear()
Sets all the bits to EMPTY.
void flip(int i)
Toggles the value of a bit.
bool erase(int value)
Tries to insert a value in the set.
bool contains(int value) const
Search if the value was already inserted or not.
void fill(ForwardIt first, ForwardIt last, const T &value)
Assigns the given value to all elements in the range [first, last).
This Source Code Form is subject to the terms of the Mozilla Public License, v.