...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Return a pointer to the value if the key is found, or null.
value const* if_contains( string_view key) const;
This function searches for a value with the given key, and returns a pointer to it if found. Otherwise it returns null.
if( auto p = obj.if_contains( "key" ) ) std::cout << *p;
Constant on average, worst case linear in size()
.
No-throw guarantee.
Name |
Description |
---|---|
|
The key of the element to find. |