According to the standard, std::vector<bool>
has no member function data()
. However, the following snippet compiles fine with the latest GCC with libstdc++:
#include <vector>
int main () {
std::vector<bool> v;
v.data();
}
If we try to use the result, it turns out the return type is void
.
Is this some gcc extension or a bug?
If the former is true, what does it do?
emplace()
andemplace_back()
. They're probably no-ops, or something. – Accomplished