(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 |
std::map| Member functions | |||||||
| Non-member functions | |||||||
| |||||||
| Deduction guides(C++17) | |||||||
bool contains(const Key& key)const; | (1) | (since C++20) (constexpr since C++26) |
template<class K> bool contains(const K& x)const; | (2) | (since C++20) (constexpr since C++26) |
Compare istransparent. It allows calling this function without constructing an instance ofKey.Contents |
| key | - | key value of the element to search for |
| x | - | a value of any type that can be transparently compared with a key |
true if there is such an element, otherwisefalse.
Logarithmic in the size of the container.
Output:
2: Found5: Not found
| finds element with specific key (public member function)[edit] | |
| returns the number of elements matching specific key (public member function)[edit] | |
| returns range of elements matching a specific key (public member function)[edit] |