Lookup¶
All methods in this section can be executed concurrently with each other, concurrently-safe modifiers and while traversing the container.
count¶
size_type count( const key_type& key );Returns: the number of elements with the key equal to
key
.
template <typename K> size_type count( const K& key );Returns: the number of elements with the key which compares equivalent with
key
.This overload only participates in overload resolution if qualified-id
hasher::transparent_key_equal
is valid and denotes a type.
find¶
iterator find( const key_type& key ); const_iterator find( const key_type& key ) const;Returns: an iterator to the element with the key equal to
key
orend()
if no such element exists.If there are multiple elements with the key equal to
key
exists, it is unspecified which element should be found.
template <typename K> iterator find( const K& key ); template <typename K> const_iterator find( const K& key ) const;Returns: an iterator to the element with the key which compares equivalent with
key
orend()
if no such element exists.If there are multiple elements with the key which compares equivalent with
key
exists, it is unspecified which element should be found.These overloads only participates in overload resolution if qualified-id
hasher::transparent_key_equal
is valid and denotes a type.
contains¶
bool contains( const key_type& key ) const;Returns:
true
if at least one element with the key equal tokey
exists in the container,false
otherwise.
template <typename K> bool contains( const K& key ) const;Returns:
true
if at least one element with the key which compares equivalent withkey
exists in the container,false
otherwise.This overload only participates in overload resolution if qualified-id
hasher::transparent_key_equal
is valid and denotes a type.
equal_range¶
std::pair<iterator, iterator> equal_range( const key_type& key ); std::pair<const_iterator, const_iterator> equal_range( const key_type& key ) const;Returns: if at least one element with the key equal to
key
exists - a pair of iterators{f, l}
, wheref
is an iterator to the first element with the key equal tokey
,l
is an iterator to the element which follows the last element with the key equal tokey
. Otherwise -{end(), end()}
.
template <typename K> std::pair<iterator, iterator> equal_range( const K& key ) template <typename K> std::pair<const_iterator, const_iterator> equal_range( const K& key )Returns: if at least one element with the key equal to
key
exists - a pair of iterators{f, l}
, wheref
is an iterator to the first element with the key which compares equivalent withkey
,l
is an iterator to the element which follows the last element with the key which compares equivalent withkey
. Otherwise -{end(), end()}
.These overloads only participates in overload resolution if qualified-id
hasher::transparent_key_equal
is valid and denotes a type.