#include <map.hpp>
Public Types | |
typedef Key | key_type |
typedef ::boost::container::allocator_traits < Allocator > | allocator_traits_type |
typedef T | mapped_type |
typedef std::pair< const Key, T > | value_type |
typedef boost::container::allocator_traits < Allocator >::pointer | pointer |
typedef boost::container::allocator_traits < Allocator >::const_pointer | const_pointer |
typedef boost::container::allocator_traits < Allocator >::reference | reference |
typedef boost::container::allocator_traits < Allocator >::const_reference | const_reference |
typedef boost::container::allocator_traits < Allocator >::size_type | size_type |
typedef boost::container::allocator_traits < Allocator >::difference_type | difference_type |
typedef Allocator | allocator_type |
typedef Compare | key_compare |
typedef std::pair< key_type, mapped_type > | nonconst_value_type |
Public Member Functions | |
typedef | BOOST_CONTAINER_IMPDEF (base_t::stored_allocator_type) stored_allocator_type |
typedef | BOOST_CONTAINER_IMPDEF (value_compare_impl) value_compare |
typedef | BOOST_CONTAINER_IMPDEF (base_t::iterator) iterator |
typedef | BOOST_CONTAINER_IMPDEF (base_t::const_iterator) const _iterator |
typedef | BOOST_CONTAINER_IMPDEF (base_t::reverse_iterator) reverse_iterator |
typedef | BOOST_CONTAINER_IMPDEF (base_t::const_reverse_iterator) const _reverse_iterator |
typedef | BOOST_CONTAINER_IMPDEF (movable_value_type_impl) movable_value_type |
map () | |
Effects: Default constructs an empty map. More... | |
map (const Compare &comp, const allocator_type &a=allocator_type()) | |
Effects: Constructs an empty map using the specified comparison object and allocator. More... | |
map (const allocator_type &a) | |
Effects: Constructs an empty map using the specified allocator. More... | |
template<class InputIterator > | |
map (InputIterator first, InputIterator last, const Compare &comp=Compare(), const allocator_type &a=allocator_type()) | |
Effects: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the range [first ,last ). More... | |
template<class InputIterator > | |
map (ordered_unique_range_t, InputIterator first, InputIterator last, const Compare &comp=Compare(), const allocator_type &a=allocator_type()) | |
Effects: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the ordered unique range [first ,last). More... | |
map (std::initializer_list< value_type > il, const Compare &comp=Compare(), const allocator_type &a=allocator_type()) | |
Effects: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the range [il.begin(), il.end()). More... | |
map (ordered_unique_range_t, std::initializer_list< value_type > il, const Compare &comp=Compare(), const allocator_type &a=allocator_type()) | |
map (const map &x) | |
Effects: Copy constructs a map. More... | |
map (BOOST_RV_REF(map) x) | |
Effects: Move constructs a map. More... | |
map (const map &x, const allocator_type &a) | |
Effects: Copy constructs a map using the specified allocator. More... | |
map (BOOST_RV_REF(map) x, const allocator_type &a) | |
Effects: Move constructs a map using the specified allocator. More... | |
map & | operator= (BOOST_COPY_ASSIGN_REF(map) x) |
Effects: Makes *this a copy of x. More... | |
map & | operator= (BOOST_RV_REF(map) x) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type |
Effects: this->swap(x.get()). More... | |
map & | operator= (std::initializer_list< value_type > il) |
Effects: Assign content of il to *this. More... | |
T & | at (const key_type &k) |
Returns: Allocator reference to the element whose key is equivalent to x. More... | |
const T & | at (const key_type &k) const |
Returns: Allocator reference to the element whose key is equivalent to x. More... | |
std::pair< iterator, bool > | insert (const value_type &x) |
Effects: Inserts x if and only if there is no element in the container with key equivalent to the key of x. More... | |
std::pair< iterator, bool > | insert (const nonconst_value_type &x) |
Effects: Inserts a new value_type created from the pair if and only if there is no element in the container with key equivalent to the key of x. More... | |
std::pair< iterator, bool > | insert (BOOST_RV_REF(nonconst_value_type) x) |
Effects: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x. More... | |
std::pair< iterator, bool > | insert (BOOST_RV_REF(movable_value_type) x) |
Effects: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x. More... | |
std::pair< iterator, bool > | insert (BOOST_RV_REF(value_type) x) |
Effects: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x. More... | |
iterator | insert (const_iterator p, const value_type &x) |
Effects: Inserts a copy of x in the container if and only if there is no element in the container with key equivalent to the key of x. More... | |
iterator | insert (const_iterator p, BOOST_RV_REF(nonconst_value_type) x) |
Effects: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x. More... | |
iterator | insert (const_iterator p, BOOST_RV_REF(movable_value_type) x) |
Effects: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x. More... | |
iterator | insert (const_iterator p, const nonconst_value_type &x) |
Effects: Inserts a copy of x in the container. More... | |
iterator | insert (const_iterator p, BOOST_RV_REF(value_type) x) |
Effects: Inserts an element move constructed from x in the container. More... | |
template<class InputIterator > | |
void | insert (InputIterator first, InputIterator last) |
Requires: first, last are not iterators into *this. More... | |
void | insert (std::initializer_list< value_type > il) |
Effects: inserts each element from the range [il.begin(), il.end()) if and only if there is no element with key equivalent to the key of that element. More... | |
size_type | count (const key_type &x) const |
Returns: The number of elements with key equivalent to x. More... | |
typedef ::boost::container::allocator_traits<Allocator> boost::container::map< Key, T, Compare, Allocator, MapOptions >::allocator_traits_type |
typedef Allocator boost::container::map< Key, T, Compare, Allocator, MapOptions >::allocator_type |
typedef boost::container::allocator_traits<Allocator>::const_pointer boost::container::map< Key, T, Compare, Allocator, MapOptions >::const_pointer |
typedef boost::container::allocator_traits<Allocator>::const_reference boost::container::map< Key, T, Compare, Allocator, MapOptions >::const_reference |
typedef boost::container::allocator_traits<Allocator>::difference_type boost::container::map< Key, T, Compare, Allocator, MapOptions >::difference_type |
typedef Compare boost::container::map< Key, T, Compare, Allocator, MapOptions >::key_compare |
typedef Key boost::container::map< Key, T, Compare, Allocator, MapOptions >::key_type |
typedef T boost::container::map< Key, T, Compare, Allocator, MapOptions >::mapped_type |
typedef std::pair<key_type, mapped_type> boost::container::map< Key, T, Compare, Allocator, MapOptions >::nonconst_value_type |
typedef boost::container::allocator_traits<Allocator>::pointer boost::container::map< Key, T, Compare, Allocator, MapOptions >::pointer |
typedef boost::container::allocator_traits<Allocator>::reference boost::container::map< Key, T, Compare, Allocator, MapOptions >::reference |
typedef boost::container::allocator_traits<Allocator>::size_type boost::container::map< Key, T, Compare, Allocator, MapOptions >::size_type |
typedef std::pair<const Key, T> boost::container::map< Key, T, Compare, Allocator, MapOptions >::value_type |
|
inline |
Effects: Default constructs an empty map.
Complexity: Constant.
|
inlineexplicit |
Effects: Constructs an empty map using the specified comparison object and allocator.
Complexity: Constant.
|
inlineexplicit |
Effects: Constructs an empty map using the specified allocator.
Complexity: Constant.
|
inline |
Effects: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the range [first ,last ).
Complexity: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first.
|
inline |
Effects: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the ordered unique range [first ,last).
This function is more efficient than the normal range creation for ordered ranges.
Requires: [first ,last) must be ordered according to the predicate and must be unique values.
Complexity: Linear in N.
Note: Non-standard extension.
|
inline |
Effects: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the range [il.begin(), il.end()).
Complexity: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is il.first() - il.end().
|
inline |
|
inline |
Effects: Copy constructs a map.
Complexity: Linear in x.size().
|
inline |
Effects: Move constructs a map.
Constructs *this using x's resources.
Complexity: Constant.
Postcondition: x is emptied.
|
inline |
Effects: Copy constructs a map using the specified allocator.
Complexity: Linear in x.size().
|
inline |
Effects: Move constructs a map using the specified allocator.
Constructs *this using x's resources.
Complexity: Constant if x == x.get_allocator(), linear otherwise.
Postcondition: x is emptied.
|
inline |
Returns: Allocator reference to the element whose key is equivalent to x.
Throws: An exception object of type out_of_range if no such element is present. Complexity: logarithmic.
|
inline |
Returns: Allocator reference to the element whose key is equivalent to x.
Throws: An exception object of type out_of_range if no such element is present. Complexity: logarithmic.
typedef boost::container::map< Key, T, Compare, Allocator, MapOptions >::BOOST_CONTAINER_IMPDEF | ( | base_t::stored_allocator_type | ) |
typedef boost::container::map< Key, T, Compare, Allocator, MapOptions >::BOOST_CONTAINER_IMPDEF | ( | value_compare_impl | ) |
typedef boost::container::map< Key, T, Compare, Allocator, MapOptions >::BOOST_CONTAINER_IMPDEF | ( | base_t::iterator | ) |
typedef boost::container::map< Key, T, Compare, Allocator, MapOptions >::BOOST_CONTAINER_IMPDEF | ( | base_t::const_iterator | ) | const |
typedef boost::container::map< Key, T, Compare, Allocator, MapOptions >::BOOST_CONTAINER_IMPDEF | ( | base_t::reverse_iterator | ) |
typedef boost::container::map< Key, T, Compare, Allocator, MapOptions >::BOOST_CONTAINER_IMPDEF | ( | base_t::const_reverse_iterator | ) | const |
typedef boost::container::map< Key, T, Compare, Allocator, MapOptions >::BOOST_CONTAINER_IMPDEF | ( | movable_value_type_impl | ) |
|
inline |
Returns: The number of elements with key equivalent to x.
Complexity: log(size())+count(k)
|
inline |
Effects: Inserts x if and only if there is no element in the container with key equivalent to the key of x.
Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.
Complexity: Logarithmic.
|
inline |
Effects: Inserts a new value_type created from the pair if and only if there is no element in the container with key equivalent to the key of x.
Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.
Complexity: Logarithmic.
|
inline |
Effects: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x.
Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.
Complexity: Logarithmic.
|
inline |
Effects: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x.
Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.
Complexity: Logarithmic.
|
inline |
Effects: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x.
Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.
Complexity: Logarithmic.
|
inline |
Effects: Inserts a copy of x in the container if and only if there is no element in the container with key equivalent to the key of x.
p is a hint pointing to where the insert should start to search.
Returns: An iterator pointing to the element with key equivalent to the key of x.
Complexity: Logarithmic in general, but amortized constant if t is inserted right before p.
|
inline |
Effects: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x.
p is a hint pointing to where the insert should start to search.
Returns: An iterator pointing to the element with key equivalent to the key of x.
Complexity: Logarithmic in general, but amortized constant if t is inserted right before p.
|
inline |
Effects: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x.
p is a hint pointing to where the insert should start to search.
Returns: An iterator pointing to the element with key equivalent to the key of x.
Complexity: Logarithmic in general, but amortized constant if t is inserted right before p.
|
inline |
Effects: Inserts a copy of x in the container.
p is a hint pointing to where the insert should start to search.
Returns: An iterator pointing to the element with key equivalent to the key of x.
Complexity: Logarithmic.
|
inline |
Effects: Inserts an element move constructed from x in the container.
p is a hint pointing to where the insert should start to search.
Returns: An iterator pointing to the element with key equivalent to the key of x.
Complexity: Logarithmic.
|
inline |
Requires: first, last are not iterators into *this.
Effects: inserts each element from the range [first,last) if and only if there is no element with key equivalent to the key of that element.
Complexity: At most N log(size()+N) (N is the distance from first to last)
|
inline |
Effects: inserts each element from the range [il.begin(), il.end()) if and only if there is no element with key equivalent to the key of that element.
Complexity: At most N log(size()+N) (N is the distance from il.begin() to il.end())
|
inline |
Effects: Makes *this a copy of x.
Complexity: Linear in x.size().
|
inline |
Effects: this->swap(x.get()).
Throws: If allocator_traits_type::propagate_on_container_move_assignment is false and (allocation throws or value_type's move constructor throws)
Complexity: Constant if allocator_traits_type:: propagate_on_container_move_assignment is true or this->get>allocator() == x.get_allocator(). Linear otherwise.
|
inline |
Effects: Assign content of il to *this.