Open
Description
When using the subscript operator [] on a vector<bool> i.e
vector<bool> a;
a.push_back(true);
cout << a[0];
results in:
error: cannot bind non-const lvalue reference of type 'bool&' to an rvalue of type 'bool'
87 | return std::vector::operator[](i);
Tested on gcc 11.2.0 and clang 13.0 for C++11
Metadata
Metadata
Assignees
Labels
No labels