Closed weiss-i-net closed 1 month ago
Thanks for the PR.
I personally find it a bit strange that a default constructor is needed (which is not properly initialized), but this seems to be okay.
Maybe add some static assert of the form static_assert(std::ranges::forward_range<BitVector>);
to ensure that the rightf range concept is supported?
I had the same thought and read the same stack overflow thread :D
The static_assert is a good idea. What would be a good place to put it?
What would be a good place to put it?
I don't think we have a 'proper' place for these kind of things.
I'd suggest in BitVector.h
right after the class declaration?
Looks good! Thanks for your contribution.
The BitVector iterators weren't default-construtable and were missing postfix increment operators and thus not fulfilling the range concept (https://en.cppreference.com/w/cpp/ranges/range). Changing this makes it possible to use BitVector with C++20s range adaptors. E.g. for code like this: