a[0] is no longer a bool&, instead a custom type pretending to be a bool& via operator overloading
can't a.data()
can't iterate via auto&& you can, but it suffers from the same issues as the aforementioned a[0] thing
access to disjoint indices is not necessarily thread-safe
iterator may not be a LegacyForwardIterator, preventing use of many standard iterator-taking functions (with an error at compile time, or at runtime, or UB if you try)
and it's not even guaranteed to use this optimisation
View all comments
Show parent comment
5
u/the_horse_gamer 11d ago
the problem is being implicit
vector<bool> breaks any remotely complex generic code
this optimisation should have been a separate type (tr2 had std::dynamic_bitset)