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 equal to
key.
template <typename K> size_type count( const K& key );Returns: the number of elements which compares equivalent with
key.This overload only participates in overload resolution if qualified-id
key_compare::is_transparentis 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 equal to
keyorend()if no such element exists.If there are multiple elements equal to
keyexists, 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 which compares equivalent with
keyorend()if no such element exists.If there are multiple elements which compares equivalent with
keyexists, it is unspecified which element should be found.These overloads only participates in overload resolution if qualified-id
key_compare::is_transparentis valid and denotes a type.
contains¶
bool contains( const key_type& key ) const;Returns:
trueif at least one element equal tokeyexists in the container,falseotherwise.
template <typename K> bool contains( const K& key ) const;Returns:
trueif at least one element which compares equivalent withkeyexists in the container,falseotherwise.This overload only participates in overload resolution if qualified-id
key_compare::is_transparentis valid and denotes a type.
lower_bound¶
iterator lower_bound( const key_type& key ); const_iterator lower_bound( const key_type& key ) const;Returns: an iterator to the first element in the container which is not less than
key.
template <typename K> iterator lower_bound( const K& key ) template <typename K> const_iterator lower_bound( const K& key ) constReturns: an iterator to the first element in the container which compares not less with
key.These overloads only participates in overload resolution if qualified-id
key_compare::is_transparentis valid and denotes a type.
upper_bound¶
iterator upper_bound( const key_type& key ); const_iterator upper_bound( const key_type& key ) const;Returns: an iterator to the first element in the container which is greater than
key.
template <typename K> iterator upper_bound( const K& key ); template <typename K> const_iterator upper_bound( const K& key ) const;Returns: an iterator to the first element in the container which compares
greaterwithkey.These overloads only participates in overload resolution if qualified-id
key_compare::is_transparentis 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 equal to
keyexists - a pair of iterators{f, l}, wherefis an iterator to the first element equal tokey,lis an iterator to the element which follows the last element 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 which compares equivalent with
keyexists - a pair of iterators{f, l}, wherefis an iterator to the first element which compares equivalent withkey,lis an iterator to the element which follows the last element which compares equivalent withkey. Otherwise -{end(), end()}.These overloads only participates in overload resolution if qualified-id
key_compare::is_transparentis valid and denotes a type.