BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR > Class Template Reference

#include <bslstl_map.h>

Classes

class  value_compare
 

Public Types

typedef KEY key_type
 
typedef VALUE mapped_type
 
typedef pair< const KEY, VALUE > value_type
 
typedef COMPARATOR key_compare
 
typedef ALLOCATOR allocator_type
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef AllocatorTraits::size_type size_type
 
typedef AllocatorTraits::difference_type difference_type
 
typedef AllocatorTraits::pointer pointer
 
typedef AllocatorTraits::const_pointer const_pointer
 
typedef BloombergLP::bslstl::TreeIterator< value_type, Node, difference_typeiterator
 
typedef BloombergLP::bslstl::TreeIterator< const value_type, Node, difference_typeconst_iterator
 
typedef bsl::reverse_iterator< iteratorreverse_iterator
 
typedef bsl::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 map ()
 
 map (const COMPARATOR &comparator, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 map (const ALLOCATOR &basicAllocator)
 
 map (const map &original)
 
 map (BloombergLP::bslmf::MovableRef< map > original)
 
 map (const map &original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
 
 map (BloombergLP::bslmf::MovableRef< map > original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
 
template<class INPUT_ITERATOR >
 map (INPUT_ITERATOR first, INPUT_ITERATOR last, const COMPARATOR &comparator=COMPARATOR(), const ALLOCATOR &basicAllocator=ALLOCATOR())
 
template<class INPUT_ITERATOR >
 map (INPUT_ITERATOR first, INPUT_ITERATOR last, const ALLOCATOR &basicAllocator)
 
 ~map ()
 Destroy this object.
 
mapoperator= (const map &rhs)
 
map &operator=(BloombergLP::bslmf::MovableRef< map > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits add_lvalue_reference< VALUE >::type operator[] (const key_type &key)
 
add_lvalue_reference< VALUE >::type operator[] (BloombergLP::bslmf::MovableRef< key_type > key)
 
add_lvalue_reference< VALUE >::type at (const key_type &key)
 
iterator begin () BSLS_KEYWORD_NOEXCEPT
 
iterator end () BSLS_KEYWORD_NOEXCEPT
 
reverse_iterator rbegin () BSLS_KEYWORD_NOEXCEPT
 
reverse_iterator rend () BSLS_KEYWORD_NOEXCEPT
 
pair< iterator, bool > insert (const value_type &value)
 
pair< iterator, bool > insert (BloombergLP::bslmf::MovableRef< value_type > value)
 
template<class ALT_VALUE_TYPE >
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, pair< iterator, bool > >::type insert (BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
 
iterator insert (const_iterator hint, const value_type &value)
 
iterator insert (const_iterator hint, BloombergLP::bslmf::MovableRef< value_type > value)
 
template<class ALT_VALUE_TYPE >
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, iterator >::type insert (const_iterator hint, BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
 
template<class INPUT_ITERATOR >
void insert (INPUT_ITERATOR first, INPUT_ITERATOR last)
 
template<class BDE_OTHER_TYPE >
pair< iterator, bool > insert_or_assign (const KEY &key, BDE_OTHER_TYPE &&obj)
 
template<class BDE_OTHER_TYPE >
pair< iterator, bool > insert_or_assign (BloombergLP::bslmf::MovableRef< KEY > key, BDE_OTHER_TYPE &&obj)
 
template<class BDE_OTHER_TYPE >
iterator insert_or_assign (const_iterator hint, const KEY &key, BDE_OTHER_TYPE &&obj)
 
template<class BDE_OTHER_TYPE >
iterator insert_or_assign (const_iterator hint, BloombergLP::bslmf::MovableRef< KEY > key, BDE_OTHER_TYPE &&obj)
 
template<class... Args>
pair< iterator, bool > emplace (Args &&... args)
 
template<class... Args>
iterator emplace_hint (const_iterator hint, Args &&... args)
 
iterator erase (const_iterator position)
 
iterator erase (iterator position)
 
size_type erase (const key_type &key)
 
iterator erase (const_iterator first, const_iterator last)
 
template<class... Args>
pair< iterator, bool > try_emplace (BloombergLP::bslmf::MovableRef< KEY > key, Args &&... args)
 
template<class LOOKUP_KEY , class... Args>
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value &&!bsl::is_convertible< LOOKUP_KEY &&, const_iterator >::value &&!bsl::is_convertible< LOOKUP_KEY &&, iterator >::value, pair< iterator, bool > >::type try_emplace (LOOKUP_KEY &&key, Args &&... args)
 
template<class... Args>
iterator try_emplace (const_iterator hint, const KEY &key, Args &&... args)
 
template<class... Args>
iterator try_emplace (const_iterator hint, BloombergLP::bslmf::MovableRef< KEY > key, Args &&... args)
 
template<class LOOKUP_KEY , class... Args>
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type try_emplace (const_iterator hint, LOOKUP_KEY &&key, Args &&... args)
 
void clear () BSLS_KEYWORD_NOEXCEPT
 
iterator find (const key_type &key)
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type find (const LOOKUP_KEY &key)
 
iterator lower_bound (const key_type &key)
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type lower_bound (const LOOKUP_KEY &key)
 
iterator upper_bound (const key_type &key)
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type upper_bound (const LOOKUP_KEY &key)
 
pair< iterator, iteratorequal_range (const key_type &key)
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, pair< iterator, iterator > >::type equal_range (const LOOKUP_KEY &key)
 
allocator_type get_allocator () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator begin () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator end () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator rbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator rend () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator cbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator cend () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator crbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator crend () const BSLS_KEYWORD_NOEXCEPT
 
bool contains (const key_type &key) const
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, bool >::type contains (const LOOKUP_KEY &key) const
 
bool empty () const BSLS_KEYWORD_NOEXCEPT
 
size_type size () const BSLS_KEYWORD_NOEXCEPT
 Return the number of elements in this map.
 
size_type max_size () const BSLS_KEYWORD_NOEXCEPT
 
add_lvalue_reference< constVALUE >::type at (const key_type &key) const
 
key_compare key_comp () const
 
value_compare value_comp () const
 
const_iterator find (const key_type &key) const
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type find (const LOOKUP_KEY &key) const
 
size_type count (const key_type &key) const
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, size_type >::type count (const LOOKUP_KEY &key) const
 
const_iterator lower_bound (const key_type &key) const
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type lower_bound (const LOOKUP_KEY &key) const
 
const_iterator upper_bound (const key_type &key) const
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type upper_bound (const LOOKUP_KEY &key) const
 
pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, pair< const_iterator, const_iterator > >::type equal_range (const LOOKUP_KEY &key) const
 
template<class BDE_OTHER_TYPE >
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > insert_or_assign (const key_type &key, BDE_OTHER_TYPE &&obj)
 
template<class BDE_OTHER_TYPE >
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > insert_or_assign (BloombergLP::bslmf::MovableRef< key_type > key, BDE_OTHER_TYPE &&obj)
 
template<class... Args>
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > emplace (Args &&... args)
 
template<class... Args>
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > try_emplace (const key_type &key, Args &&... args)
 
template<class... Args>
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > try_emplace (BloombergLP::bslmf::MovableRef< key_type > key, Args &&... args)
 

Public Attributes

template<class... Args>
void swap(map &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits pair< iterator, bool > try_emplace (const KEY &key, Args &&... args)
 

Detailed Description

template<class KEY, class VALUE, class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
class bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >

This class template implements a value-semantic container type holding an ordered sequence of key-value pairs having unique keys that provide a mapping from keys (of the template parameter type, KEY) to their associated values (of another template parameter type, VALUE).

This class:

  • supports a complete set of value-semantic operations
    • except for BDEX serialization
  • is exception-neutral
  • is alias-safe
  • is const thread-safe For terminology see bsldoc_glossary .

See bslstl_map

Member Typedef Documentation

◆ allocator_type

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef ALLOCATOR bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::allocator_type

◆ const_iterator

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef BloombergLP::bslstl::TreeIterator< const value_type, Node, difference_type> bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_iterator

◆ const_pointer

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef AllocatorTraits::const_pointer bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_pointer

◆ const_reference

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef const value_type& bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_reference

◆ const_reverse_iterator

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef bsl::reverse_iterator<const_iterator> bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_reverse_iterator

◆ difference_type

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef AllocatorTraits::difference_type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::difference_type

◆ iterator

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef BloombergLP::bslstl::TreeIterator< value_type, Node, difference_type> bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator

◆ key_compare

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef COMPARATOR bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::key_compare

◆ key_type

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef KEY bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::key_type

◆ mapped_type

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef VALUE bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::mapped_type

◆ pointer

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef AllocatorTraits::pointer bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::pointer

◆ reference

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef value_type& bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::reference

◆ reverse_iterator

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef bsl::reverse_iterator<iterator> bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::reverse_iterator

◆ size_type

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef AllocatorTraits::size_type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::size_type

◆ value_type

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
typedef pair<const KEY, VALUE> bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_type

Constructor & Destructor Documentation

◆ map() [1/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( )
inline

◆ map() [2/9]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( const COMPARATOR &  comparator,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
inlineexplicit

Create an empty map. Optionally specify a comparator used to order key-value pairs contained in this object. If comparator is not supplied, a default-constructed object of the (template parameter) type COMPARATOR is used. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used.

◆ map() [3/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( const ALLOCATOR &  basicAllocator)
inlineexplicit

Create an empty map that uses the specified basicAllocator to supply memory. Use a default-constructed object of the (template parameter) type COMPARATOR to order the key-value pairs contained in this map. Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

◆ map() [4/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( const map< KEY, VALUE, COMPARATOR, ALLOCATOR > &  original)
inline

Create a map having the same value as the specified original object. Use a copy of original.key_comp() to order the key-value pairs contained in this map. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to allocate memory. If the (template parameter) type ALLOCATOR is bsl::allocator (the default), the currently installed default allocator is used. This method requires that the (template parameter) types KEY and VALUE both be copy-insertable into this map (see {Requirements on KEY and VALUE}).

◆ map() [5/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( BloombergLP::bslmf::MovableRef< map< KEY, VALUE, COMPARATOR, ALLOCATOR > >  original)
inline

Create a map having the same value as the specified original object by moving (in constant time) the contents of original to the new map. Use a copy of original.key_comp() to order the key-value pairs contained in this map. The allocator associated with original is propagated for use in the newly-created map. original is left in a valid but unspecified state.

◆ map() [6/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( const map< KEY, VALUE, COMPARATOR, ALLOCATOR > &  original,
const typename type_identity< ALLOCATOR >::type &  basicAllocator 
)
inline

Create a map having the same value as the specified original object that uses the specified basicAllocator to supply memory. Use a copy of original.key_comp() to order the key-value pairs contained in this map. This method requires that the (template parameter) types KEY and VALUE both be copy-insertable into this map (see {Requirements on KEY and VALUE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

◆ map() [7/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( BloombergLP::bslmf::MovableRef< map< KEY, VALUE, COMPARATOR, ALLOCATOR > >  original,
const typename type_identity< ALLOCATOR >::type &  basicAllocator 
)
inline

Create a map having the same value as the specified original object that uses the specified basicAllocator to supply memory. The contents of original are moved (in constant time) to the new map if basicAllocator == original.get_allocator(), and are move- inserted (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. Use a copy of original.key_comp() to order the key-value pairs contained in this map. This method requires that the (template parameter) types KEY and VALUE both be move-insertable into this map (see {Requirements on KEY and VALUE}). Note that a bslma::Allocator * can be supplied for basicAllocator if the (template parameter) ALLOCATOR is bsl::allocator (the default).

◆ map() [8/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class INPUT_ITERATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
const COMPARATOR &  comparator = COMPARATOR(),
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
inline

Create a map, and insert each value_type object in the sequence starting at the specified first element, and ending immediately before the specified last element, ignoring those objects having a key equivalent to that which appears earlier in the sequence. Optionally specify a comparator used to order key-value pairs contained in this object. If comparator is not supplied, a default-constructed object of the (template parameter) type COMPARATOR is used. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not supplied, a default-constructed object of the (template parameter) type ALLOCATOR is used. If the type ALLOCATOR is bsl::allocator (the default), then basicAllocator, if supplied, shall be convertible to bslma::Allocator *. If the type ALLOCATOR is bsl::allocator and basicAllocator is not supplied, the currently installed default allocator is used. If the sequence first to last is ordered according to comparator, then this operation has O[N] complexity, where N is the number of elements between first and last; otherwise, this operation has O[N * log(N)] complexity. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this map, where i is a dereferenceable iterator in the range [first .. last) (see {Requirements on KEY and VALUE}). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

◆ map() [9/9]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class INPUT_ITERATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::map ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last,
const ALLOCATOR &  basicAllocator 
)
inline

◆ ~map()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::~map ( )
inline

Member Function Documentation

◆ at() [1/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
add_lvalue_reference< VALUE >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::at ( const key_type key)

Return a reference providing modifiable access to the mapped-value associated with the specified key, if such an entry exists; otherwise, throw a std::out_of_range exception. Note that this method may also throw a different kind of exception if the (user-supplied) comparator throws.

◆ at() [2/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
add_lvalue_reference< constVALUE >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::at ( const key_type key) const

Return a reference providing non-modifiable access to the mapped-value associated with a key that is equivalent to the specified key, if such an entry exists; otherwise, throw a std::out_of_range exception. Note that this method may also throw a different kind of exception if the (user-supplied) comparator throws.

◆ begin() [1/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::begin ( )
inline

Return an iterator providing modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this map, or the end iterator if this map is empty.

◆ begin() [2/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::begin ( ) const
inline

Return an iterator providing non-modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this map, or the end iterator if this map is empty.

◆ cbegin()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::cbegin ( ) const
inline

Return an iterator providing non-modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this map, or the cend iterator if this map is empty.

◆ cend()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::cend ( ) const
inline

Return an iterator providing non-modifiable access to the past-the-end element in the ordered sequence of value_type objects maintained by this map.

◆ clear()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
void bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::clear ( )
inline

Remove all entries from this map. Note that the map is empty after this call, but allocated memory may be retained for future use.

◆ contains() [1/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bool bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::contains ( const key_type key) const
inline

Return true if this map contains an element whose key is equivalent to the specified key.

◆ contains() [2/2]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, bool >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::contains ( const LOOKUP_KEY &  key) const
inline

Return true if this map contains an element whose key is equivalent to the specified key.

Note: implemented inline due to Sun CC compilation error

◆ count() [1/2]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
size_type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::count ( const key_type key) const
inline

Return the number of value_type objects within this map whose keys are equivalent to the specified key. Note that since a map maintains unique keys, the returned value will be either 0 or 1.

Note: implemented inline due to Sun CC compilation error.

◆ count() [2/2]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, size_type >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::count ( const LOOKUP_KEY &  key) const
inline

Return the number of value_type objects within this map whose keys are equivalent to the specified key. Note that although a map maintains unique keys, the returned value can be other than 0 or 1, because a transparent comparator may have been supplied that provides a different (but compatible) partitioning of keys for LOOKUP_KEY as the comparisons used to order the keys in the map.

Note: implemented inline due to Sun CC compilation error.

◆ crbegin()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_reverse_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::crbegin ( ) const
inline

Return a reverse iterator providing non-modifiable access to the last value_type object in the ordered sequence of value_type objects maintained by this map, or crend if this map is empty.

◆ crend()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_reverse_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::crend ( ) const
inline

Return a reverse iterator providing non-modifiable access to the prior-to-the-beginning element in the ordered sequence of value_type objects maintained by this map.

◆ emplace() [1/2]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class... Args>
pair< iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::emplace ( Args &&...  args)

Insert into this map a newly-created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) args to the corresponding constructor of value_type, if a key equivalent to such a value does not already exist in this map; otherwise, this method has no effect (other than possibly creating a temporary value_type object). Return a pair whose first member is an iterator referring to the (possibly newly created and inserted) object in this map whose key is equivalent to that of an object constructed from args, and whose second member is true if a new value was inserted, and false if an equivalent key was already present. This method requires that the (template parameter) types KEY and VALUE both be emplace-constructible from args (see {Requirements on KEY and VALUE}).

◆ emplace() [2/2]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class... Args>
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::emplace ( Args &&...  args)
inline

◆ emplace_hint()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class... Args>
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::emplace_hint ( const_iterator  hint,
Args &&...  args 
)
inline

Insert into this map a newly-created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) args to the corresponding constructor of value_type (in amortized constant time if the specified hint is a valid immediate successor to the value_type object constructed from args), if a key equivalent to such a value does not already exist in this map; otherwise, this method has no effect (other than possibly creating a temporary value_type object). Return an iterator referring to the (possibly newly created and inserted) object in this map whose key is equivalent to that of an object constructed from args. If hint is not a valid immediate successor to the value_type object implied by args, this operation has O[log(N)] complexity where N is the size of this map. This method requires that the (template parameter) types KEY and VALUE both be emplace-constructible from args (see {Requirements on KEY and VALUE}). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

◆ empty()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
bool bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::empty ( ) const
inline

Return true if this map contains no elements, and false otherwise.

◆ end() [1/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::end ( )
inline

Return an iterator providing modifiable access to the past-the-end element in the ordered sequence of value_type objects maintained by this map.

◆ end() [2/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::end ( ) const
inline

Return an iterator providing non-modifiable access to the past-the-end element in the ordered sequence of value_type objects maintained by this map.

◆ equal_range() [1/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
pair< iterator, iterator > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::equal_range ( const key_type key)
inline

Return a pair of iterators providing modifiable access to the sequence of value_type objects in this map whose keys are equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key), the second returned iterator will be upper_bound(key), and, if this map contains no value_type objects with an equivalent key, then the two returned iterators will have the same value. Note that since a map maintains unique keys, the range will contain at most one element.

Note: implemented inline due to Sun CC compilation error.

◆ equal_range() [2/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
pair< const_iterator, const_iterator > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::equal_range ( const key_type key) const
inline

Return a pair of iterators providing non-modifiable access to the sequence of value_type objects in this map whose keys are equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second iterator is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key), the second returned iterator will be upper_bound(key), and, if this map contains no value_type objects having keys equivalent to key, then the two returned iterators will have the same value. Note that since a map maintains unique keys, the range will contain at most one element.

Note: implemented inline due to Sun CC compilation error.

◆ equal_range() [3/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, pair< iterator, iterator > >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::equal_range ( const LOOKUP_KEY &  key)
inline

Return a pair of iterators providing modifiable access to the sequence of value_type objects in this map whose keys are equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key), the second returned iterator will be upper_bound(key), and, if this map contains no value_type objects with an equivalent key, then the two returned iterators will have the same value. Note that although a map maintains unique keys, the range may contain more than one element, because a transparent comparator may have been supplied that provides a different (but compatible) partitioning of keys for LOOKUP_KEY as the comparisons used to order the keys in the map.

Note: implemented inline due to Sun CC compilation error.

◆ equal_range() [4/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, pair< const_iterator, const_iterator > >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::equal_range ( const LOOKUP_KEY &  key) const
inline

Return a pair of iterators providing non-modifiable access to the sequence of value_type objects in this map whose keys are equivalent to the specified key, where the first iterator is positioned at the start of the sequence and the second iterator is positioned one past the end of the sequence. The first returned iterator will be lower_bound(key), the second returned iterator will be upper_bound(key), and, if this map contains no value_type objects having keys equivalent to key, then the two returned iterators will have the same value. Note that although a map maintains unique keys, the range may contain more than one element, because a transparent comparator may have been supplied that provides a different (but compatible) partitioning of keys for LOOKUP_KEY as the comparisons used to order the keys in the map.

Note: implemented inline due to Sun CC compilation error.

◆ erase() [1/4]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::size_type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::erase ( const key_type key)
inline

Remove from this map the value_type object whose key is equivalent the specified key, if such an entry exists, and return 1; otherwise, if there is no value_type object having an equivalent key, return 0 with no other effect. This method invalidates only iterators and references to the removed element and previously saved values of the end() iterator.

◆ erase() [2/4]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::erase ( const_iterator  first,
const_iterator  last 
)
inline

◆ erase() [3/4]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::erase ( const_iterator  position)
inline

◆ erase() [4/4]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::erase ( iterator  position)
inline

Remove from this map the value_type object at the specified position, and return an iterator referring to the element immediately following the removed element, or to the past-the-end position if the removed element was the last element in the sequence of elements maintained by this map. This method invalidates only iterators and references to the removed element and previously saved values of the end() iterator. The behavior is undefined unless position refers to a value_type object in this map.

◆ find() [1/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::find ( const key_type key)
inline

Return an iterator providing modifiable access to the value_type object in this map whose key is equivalent to the specified key, if such an entry exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

◆ find() [2/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::find ( const key_type key) const
inline

Return an iterator providing non-modifiable access to the value_type object in this map whose key is equivalent to the specified key, if such an entry exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

◆ find() [3/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::find ( const LOOKUP_KEY &  key)
inline

Return an iterator providing modifiable access to the value_type object in this map whose key is equivalent to the specified key, if such an entry exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

◆ find() [4/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::find ( const LOOKUP_KEY &  key) const
inline

Return an iterator providing non-modifiable access to the value_type object in this map whose key is equivalent to the specified key, if such an entry exists, and the past-the-end (end) iterator otherwise.

Note: implemented inline due to Sun CC compilation error.

◆ get_allocator()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::allocator_type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::get_allocator ( ) const
inline

Return (a copy of) the allocator used for memory allocation by this map.

◆ insert() [1/7]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( BloombergLP::bslmf::MovableRef< value_type value)
inline

Insert into this map the specified value if a key (the first element) equivalent to that of value does not already exist in this map; otherwise, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this map whose key is equivalent to that of value, and whose second member is true if a new value was inserted and false if the key was already present. This method requires that the (template parameter) types KEY and VALUE both be move-insertable into this map (see {Requirements on KEY and VALUE}).

◆ insert() [2/7]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class ALT_VALUE_TYPE >
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, pair< iterator, bool > >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE)  value)
inline

◆ insert() [3/7]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( const value_type value)
inline

Insert the specified value into this map if a key (the first element) equivalent to that of value does not already exist in this map; otherwise, if a value_type object whose key is equivalent to that of value already exists in this map, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this map whose key is equivalent to that of value, and whose second member is true if a new value was inserted, and false if the key was already present. This method requires that the (template parameter) types KEY and VALUE both be copy-insertable into this map (see {Requirements on KEY and VALUE}).

◆ insert() [4/7]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( const_iterator  hint,
BloombergLP::bslmf::MovableRef< value_type value 
)
inline

Insert into this map the specified value (in amortized constant time if the specified hint is a valid immediate successor to value) if a key (the first element) equivalent to that of value does not already exist in this map; otherwise, this method has no effect. Return an iterator referring to the (possibly newly inserted) value_type object in this map whose key is equivalent to that of value. If hint is not a valid immediate successor to value, this operation has O[log(N)] complexity, where N is the size of this map. This method requires that the (template parameter) types KEY and VALUE both be move-insertable into this map (see {Requirements on KEY and VALUE}). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

◆ insert() [5/7]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class ALT_VALUE_TYPE >
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( const_iterator  hint,
BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE)  value 
)
inline

◆ insert() [6/7]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( const_iterator  hint,
const value_type value 
)
inline

Insert the specified value into this map (in amortized constant time if the specified hint is a valid immediate successor to the key of value) if a key (the first element) equivalent to that of value does not already exist in this map; otherwise, if a value_type object whose key is equivalent to that of value already exists in this map, this method has no effect. Return an iterator referring to the (possibly newly inserted) value_type object in this map whose key is equivalent to that of value. If hint is not a valid immediate successor to the key of value, this operation has O[log(N)] complexity, where N is the size of this map. This method requires that the (template parameter) types KEY and VALUE both be copy-insertable into this map (see {Requirements on KEY and VALUE}). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).

◆ insert() [7/7]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class INPUT_ITERATOR >
void bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert ( INPUT_ITERATOR  first,
INPUT_ITERATOR  last 
)
inline

Insert into this map the value of each value_type object in the range starting at the specified first iterator and ending immediately before the specified last iterator, if a key equivalent to that of the object is not already contained in this map. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators] providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this map, where i is a dereferenceable iterator in the range [first .. last) (see {Requirements on KEY and VALUE}). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

Implementation Notes

◆ insert_or_assign() [1/6]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class BDE_OTHER_TYPE >
pair< iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert_or_assign ( BloombergLP::bslmf::MovableRef< KEY >  key,
BDE_OTHER_TYPE &&  obj 
)

If a key equivalent to the specified key already exists in this map, assign the specified obj to the value associated with that key, and return a pair containing an iterator referring to the existing item and false. Otherwise, insert into this map a newly-created value_type object, constructed from (std::forward<KEY>(key), std::forward<BDE_OTHER_TYPE>(obj)...)), and return a pair containing an iterator referring to the newly-created entry and true.

◆ insert_or_assign() [2/6]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class BDE_OTHER_TYPE >
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert_or_assign ( BloombergLP::bslmf::MovableRef< key_type key,
BDE_OTHER_TYPE &&  obj 
)
inline

◆ insert_or_assign() [3/6]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class BDE_OTHER_TYPE >
pair< iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert_or_assign ( const KEY &  key,
BDE_OTHER_TYPE &&  obj 
)

If a key equivalent to the specified key already exists in this map, assign the specified obj to the value associated with that key, and return a pair containing an iterator referring to the existing item and false. Otherwise, insert into this map a newly-created value_type object, constructed from (key, std::forward<BDE_OTHER_TYPE>(obj)...)), and return a pair containing an iterator referring to the newly-created entry and true.

◆ insert_or_assign() [4/6]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class BDE_OTHER_TYPE >
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert_or_assign ( const key_type key,
BDE_OTHER_TYPE &&  obj 
)
inline

◆ insert_or_assign() [5/6]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class BDE_OTHER_TYPE >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert_or_assign ( const_iterator  hint,
BloombergLP::bslmf::MovableRef< KEY >  key,
BDE_OTHER_TYPE &&  obj 
)
inline

If a key equivalent to the specified key already exists in this _map, assign the specified obj to the value associated with that key, and return an iterator referring to the existing item. Otherwise, insert into this map a newly-created value_type object constructed from (std::forward<KEY>(key), std::forward<BDE_OTHER_TYPE>(obj)...)), and return an iterator referring to the newly-created entry. Use the specified hint as a starting point for checking to see if the key already in the map.

◆ insert_or_assign() [6/6]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class BDE_OTHER_TYPE >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::insert_or_assign ( const_iterator  hint,
const KEY &  key,
BDE_OTHER_TYPE &&  obj 
)
inline

If a key equivalent to the specified key already exists in this map, assign the specified obj to the value associated with that key, and return an iterator referring to the existing item. Otherwise, insert into this map a newly-created value_type object, constructed from (key, std::forward<BDE_OTHER_TYPE>(obj)...)), and return an iterator referring to the newly-created entry. Use the specified hint as a starting point for checking to see if the key is already in the map.

◆ key_comp()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::key_compare bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::key_comp ( ) const
inline

Return the key-comparison functor (or function pointer) used by this map; if a comparator was supplied at construction, return its value; otherwise, return a default constructed key_compare object. Note that this comparator compares objects of type KEY, which is the key part of the value_type objects contained in this map.

◆ lower_bound() [1/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::lower_bound ( const key_type key)
inline

Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ lower_bound() [2/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::lower_bound ( const key_type key) const
inline

Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ lower_bound() [3/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::lower_bound ( const LOOKUP_KEY &  key)
inline

Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ lower_bound() [4/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::lower_bound ( const LOOKUP_KEY &  key) const
inline

Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater-than or equal-to the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than or equal-to key. Note that this function returns the first position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ max_size()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::size_type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::max_size ( ) const
inline

Return a theoretical upper bound on the largest number of elements that this map could possibly hold. Note that there is no guarantee that the map can successfully grow to the returned size, or even close to that size without running out of resources.

◆ operator=()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR > & bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::operator= ( const map< KEY, VALUE, COMPARATOR, ALLOCATOR > &  rhs)
inline

Assign to this object the value and comparator of the specified rhs object, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_copy_assignment, and return a reference providing modifiable access to this object. If an exception is thrown, *this is left in a valid but unspecified state. This method requires that the (template parameter) types KEY and VALUE both be copy-assignable and copy-insertable into this map (see {Requirements on KEY and VALUE}).

◆ operator[]() [1/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
add_lvalue_reference< VALUE >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::operator[] ( BloombergLP::bslmf::MovableRef< key_type key)
inline

Return a reference providing modifiable access to the mapped-value associated with the specified key; if this map does not already contain a value_type object having an equivalent key, first insert a new value_type object having the move-inserted key and a default-constructed VALUE object, and return a reference to the newly mapped (default) value. This method requires that the (template parameter) type KEY be move-insertable into this map and the (template parameter) type VALUE be default-insertable into this map (see {Requirements on KEY and VALUE}).

◆ operator[]() [2/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
add_lvalue_reference< VALUE >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::operator[] ( const key_type key)
inline

Return a reference providing modifiable access to the mapped-value associated with the specified key; if this map does not already contain a value_type object having an equivalent key, first insert a new value_type object having key and a default-constructed VALUE object, and return a reference to the newly mapped (default) value. This method requires that the (template parameter) type KEY be copy-insertable into this map and the (template parameter) type VALUE be default-insertable into this map (see {Requirements on KEY and VALUE}).

◆ rbegin() [1/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::reverse_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::rbegin ( )
inline

Return a reverse iterator providing modifiable access to the last value_type object in the ordered sequence of value_type objects maintained by this map, or rend if this map is empty.

◆ rbegin() [2/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_reverse_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::rbegin ( ) const
inline

Return a reverse iterator providing non-modifiable access to the last value_type object in the ordered sequence of value_type objects maintained by this map, or rend if this map is empty.

◆ rend() [1/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::reverse_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::rend ( )
inline

Return a reverse iterator providing modifiable access to the prior-to-the-beginning element in the ordered sequence of value_type objects maintained by this map.

◆ rend() [2/2]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::const_reverse_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::rend ( ) const
inline

Return a reverse iterator providing non-modifiable access to the prior-to-the-beginning element in the ordered sequence of value_type objects maintained by this map.

◆ size()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::size_type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::size ( ) const
inline

◆ try_emplace() [1/7]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class... Args>
pair< iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace ( BloombergLP::bslmf::MovableRef< KEY >  key,
Args &&...  args 
)

◆ try_emplace() [2/7]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class... Args>
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace ( BloombergLP::bslmf::MovableRef< key_type key,
Args &&...  args 
)
inline

◆ try_emplace() [3/7]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class... Args>
pair< typename map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace ( const key_type key,
Args &&...  args 
)
inline

◆ try_emplace() [4/7]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class... Args>
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace ( const_iterator  hint,
BloombergLP::bslmf::MovableRef< KEY >  key,
Args &&...  args 
)
inline

◆ try_emplace() [5/7]

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
template<class... Args>
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace ( const_iterator  hint,
const KEY &  key,
Args &&...  args 
)
inline

If a key equivalent to the specified key already exists in this map, return an iterator referring to the existing item. Otherwise, insert into this map a newly-created value_type object, constructed from from key and the specified args, and return an iterator referring to the newly-created entry. Use the specified hint as a starting point for checking to see if the key already in the map. This method requires that the (template parameter) types KEY and VALUE are emplace-constructible from key and args respectively. For C++03, VALUE must also be copy-constructible.

Note: implemented inline due to Sun CC compilation error.

◆ try_emplace() [6/7]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY , class... Args>
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace ( const_iterator  hint,
LOOKUP_KEY &&  key,
Args &&...  args 
)
inline

◆ try_emplace() [7/7]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY , class... Args>
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value &&!bsl::is_convertible< LOOKUP_KEY &&, const_iterator >::value &&!bsl::is_convertible< LOOKUP_KEY &&, iterator >::value, pair< iterator, bool > >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace ( LOOKUP_KEY &&  key,
Args &&...  args 
)
inline

◆ upper_bound() [1/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::upper_bound ( const key_type key)
inline

Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater than the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ upper_bound() [2/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
const_iterator bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::upper_bound ( const key_type key) const
inline

Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater than the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ upper_bound() [3/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::upper_bound ( const LOOKUP_KEY &  key)
inline

Return an iterator providing modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater than the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ upper_bound() [4/4]

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class LOOKUP_KEY >
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::upper_bound ( const LOOKUP_KEY &  key) const
inline

Return an iterator providing non-modifiable access to the first (i.e., ordered least) value_type object in this map whose key is greater than the specified key, and the past-the-end iterator if this map does not contain a value_type object whose key is greater-than key. Note that this function returns the last position before which a value_type object having an equivalent key could be inserted into the ordered sequence maintained by this map, while preserving its ordering.

Note: implemented inline due to Sun CC compilation error.

◆ value_comp()

template<class KEY , class VALUE , class COMPARATOR , class ALLOCATOR >
map< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_compare bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::value_comp ( ) const
inline

Return a functor for comparing two value_type objects by comparing their respective keys using key_comp(). Note that this comparator compares objects of type value_type (i.e., bsl::pair<const KEY, VALUE>).

Member Data Documentation

◆ try_emplace

template<class KEY , class VALUE , class COMPARATOR = std::less<KEY>, class ALLOCATOR = allocator<pair<const KEY, VALUE> >>
template<class... Args>
void swap(map &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits pair< iterator, bool > bsl::map< KEY, VALUE, COMPARATOR, ALLOCATOR >::try_emplace(const KEY &key, Args &&... args)

Remove from this map the value_type objects starting at the specified first position up to, but including the specified last position, and return last. This method invalidates only iterators and references to the removed element and previously saved values of the end() iterator. The behavior is undefined unless first and last either refer to elements in this map or are the end iterator, and the first position is at or before the last position in the ordered sequence provided by this container. If a key equivalent to the specified key already exists in this map, return a pair containing an iterator referring to the existing item and false. Otherwise, insert into this map a newly-created entry constructed from key and the specified args, and return a pair containing an iterator referring to the newly-created entry and true. This method requires that the (template parameter) types KEY and VALUE are emplace-constructible from key and args respectively. For C++03, VALUE must also be copy-constructible.

Note: implemented inline due to Sun CC compilation error.


The documentation for this class was generated from the following file: