10 auto it = expected.begin();
12 REQUIRE(it != expected.end());
15 CHECK(it == expected.end());
21 REQUIRE((list.size() % 2) == 0);
22 std::vector<size_t> v;
23 auto f = list.begin();
28 for (
auto i = b; i != e; ++i) v.push_back(i);
31 v.erase(std::unique(v.begin(), v.end()), v.end());
37void test(std::initializer_list<size_t> list)
42 REQUIRE((list.size() % 2) == 0);
43 auto f = list.begin();
60 SECTION(
"single word") {
66 SECTION(
"multiple words") {
79 SECTION(
"set single") {
80 SECTION(
"single word") {
90 SECTION(
"multiple words") {
101 SECTION(
"set range") {
102 SECTION(
"single word") {
120 test<32>({10, 20, 25, 30});
122 SECTION(
"multiple words") {
143 test<256>({10, 127});
144 test<256>({10, 128});
145 test<256>({10, 143});
146 test<256>({10, 255});
147 test<256>({10, 256});
153 test<256>({63, 127});
154 test<256>({63, 128});
155 test<256>({63, 143});
156 test<256>({63, 255});
157 test<256>({63, 256});
162 test<256>({64, 127});
163 test<256>({64, 128});
164 test<256>({64, 143});
165 test<256>({64, 255});
166 test<256>({64, 256});
168 test<256>({10, 20, 40, 50});
169 test<256>({10, 20, 60, 70});
170 test<256>({10, 40, 20, 30});
171 test<256>({10, 40, 20, 50});
TEST_CASE("IterableBitSet")
void expect(const IterableBitSet< N > &s, const std::vector< size_t > &expected)
void test(const IterableBitSet< N > &s, std::initializer_list< size_t > list)
bool empty() const
(Implicit) default constructor.
void setPosN(size_t pos, size_t n)
Starting from position 'pos', set the 'n' following bits to '1'.
void setRange(size_t begin, size_t end)
Set all bits in the half-open range [begin, end) to '1'.
void foreachSetBit(std::invocable< size_t > auto op) const
Execute the given operation 'op' for all '1' bits.
void set(size_t pos)
Set the (single) bit at position 'pos' to '1'.
constexpr void sort(RandomAccessRange &&range)