(C++17) | ||||
| Sequence | ||||
(C++11) | ||||
(C++26) | ||||
(C++26) | ||||
(C++11) | ||||
| Associative | ||||
| Unordered associative | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
| Adaptors | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
| Views | ||||
(C++20) | ||||
(C++23) | ||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
| Member types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Non-member functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper classes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Deduction guides(C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <vector> | ||
void flip(); | (constexpr since C++20) | |
Toggles eachbool (replaces with its opposite value) in thevector.
#include <iostream>#include <vector> void print(conststd::vector<bool>& vb){for(constbool b: vb)std::cout<< b;std::cout<<'\n';} int main(){std::vector<bool> v{0,1,0,1}; print(v); v.flip(); print(v);}
Output:
01011010
| access specified element (public member function of std::vector<T,Allocator>)[edit] | |
| toggles the values of bits (public member function of std::bitset<N>)[edit] |