13 template <
int N,
typename T>
14 typename BitSet<N, T>::iterator BitSet<N, T>::begin()
16 return m_data.begin();
19 template <
int N,
typename T>
20 typename BitSet<N, T>::iterator BitSet<N, T>::end()
22 return m_data.begin() + N;
27 template <
int N,
typename T>
33 template <
int N,
typename T>
37 "Attempted to remove a value that is outside the scope of the BitSet");
38 const int byte =
value / BIT_SIZE;
46 template <
int N,
typename T>
49 PONCA_ASSERT_MSG(
value >= 0 &&
value <
N,
"Inserted value is outside the scope of the BitSet");
50 const int byte =
value / BIT_SIZE;
58 template <
int N,
typename T>
61 PONCA_ASSERT_MSG(
value >= 0 &&
value <
N,
"Searched value is outside the scope of the BitSet");
62 const int byte =
value / BIT_SIZE;
64 return (m_data[
byte] & (T(1) <<
bit)) != 0;
70 template <
int N,
typename T>
73 PONCA_ASSERT_MSG(
i >= 0 &&
i <
N,
"Flipped value is outside the scope of the BitSet");
74 const int byte =
i / BIT_SIZE;
75 const int bit =
i % BIT_SIZE;
Aggregator class used to declare specialized structures using CRTP.
std::pair< iterator, bool > insert(const 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.