Hi. According to the C++ Standard (section [vector.bool]), std::vector::const_reference should be defined as bool. libc++ defines it as std::__1::__bit_const_reference<std::__1::vector<bool, std::__1::allocator>>]. Is this divergence from the standard intentional? If it is, what is the purpose?
Unless I’m mis-reading the spec, vector<bool>::const_reference
is implementation defined. Not bool. See [vector.bool].
/Eric
Unless I'm mis-reading the spec, `vector<bool>::const_reference` is
implementation defined. Not bool. See [vector.bool]
<http://eel.is/c++draft/vector.bool>\.
It says:
using const_reference = bool;
Looking again, it seems like a libc++ bug. Not sure if Howard intended to be non-conforming here, but it’s likely a mistake.
Feel free to file a bug.
/Eric
Actually Howard explains this non-conformance in a self answer Stackoverflow question "Why is libc++'s vector::const_reference not bool?”:
https://stackoverflow.com/q/31974237/1708801
Regards
Shafik