Why doesn’t std::bitset come with iterators?

I don’t think there was ever an actual decision to exclude iterators from bitset. Rather, bitset is one of the classes that predates the proposal to add the original Standard Template Library to the C++ standard. When it was designed, essentially none of the standard library included iterators. Then, Stepanov’s library was proposed for addition, … Read more

Why is libc++’s vector::const_reference not bool?

The motivation for this extension, which is detectable by a conforming program, and thus non-conforming, is to make vector<bool> behave more like vector<char> with respect to references (const and otherwise). Introduction Since 1998, vector<bool> has been derided as “not quite a container.” LWG 96, one of the very first LWG issues, launched the debate. Today, … Read more

tech