61#if __cplusplus >= 201103L
65#if __glibcxx_containers_ranges
70namespace std _GLIBCXX_VISIBILITY(default)
72_GLIBCXX_BEGIN_NAMESPACE_VERSION
73_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
75 template <
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
104 template <
typename _Key,
typename _Tp,
typename _Compare = std::less<_Key>,
105 typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
109 typedef _Key key_type;
110 typedef _Tp mapped_type;
112 typedef _Compare key_compare;
113 typedef _Alloc allocator_type;
116#ifdef _GLIBCXX_CONCEPT_CHECKS
118 typedef typename _Alloc::value_type _Alloc_value_type;
119# if __cplusplus < 201103L
120 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
122 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
123 _BinaryFunctionConcept)
124 __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
127#if __cplusplus >= 201103L
128#if __cplusplus > 201703L || defined __STRICT_ANSI__
130 "std::map must have the same value_type as its allocator");
135#pragma GCC diagnostic push
136#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
140 friend class map<_Key, _Tp, _Compare, _Alloc>;
144 value_compare(_Compare __c)
148 bool operator()(
const value_type& __x,
const value_type& __y)
const
151#pragma GCC diagnostic pop
156 rebind<value_type>::other _Pair_alloc_type;
158 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
159 key_compare, _Pair_alloc_type> _Rep_type;
166#if __cplusplus >= 201703L
167 template<
typename _Up,
typename _Vp = remove_reference_t<_Up>>
168 static constexpr bool __usable_key
169 = __or_v<is_same<const _Vp, const _Key>,
176 typedef typename _Alloc_traits::pointer pointer;
177 typedef typename _Alloc_traits::const_pointer const_pointer;
178 typedef typename _Alloc_traits::reference reference;
179 typedef typename _Alloc_traits::const_reference const_reference;
180 typedef typename _Rep_type::iterator iterator;
181 typedef typename _Rep_type::const_iterator const_iterator;
182 typedef typename _Rep_type::size_type size_type;
183 typedef typename _Rep_type::difference_type difference_type;
184 typedef typename _Rep_type::reverse_iterator reverse_iterator;
185 typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
187#ifdef __glibcxx_node_extract
188 using node_type =
typename _Rep_type::node_type;
189 using insert_return_type =
typename _Rep_type::insert_return_type;
198#if __cplusplus < 201103L
210 map(
const _Compare& __comp,
211 const allocator_type& __a = allocator_type())
212 : _M_t(__comp, _Pair_alloc_type(__a)) { }
219#if __cplusplus < 201103L
245 const _Compare& __comp = _Compare(),
246 const allocator_type& __a = allocator_type())
247 : _M_t(__comp, _Pair_alloc_type(__a))
248 { _M_t._M_insert_range_unique(__l.begin(), __l.end()); }
252 map(
const allocator_type& __a)
253 : _M_t(_Pair_alloc_type(__a)) { }
256 map(
const map& __m,
const __type_identity_t<allocator_type>& __a)
257 : _M_t(__m._M_t, _Pair_alloc_type(__a)) { }
260 map(
map&& __m,
const __type_identity_t<allocator_type>& __a)
262 && _Alloc_traits::_S_always_equal())
263 : _M_t(
std::
move(__m._M_t), _Pair_alloc_type(__a)) { }
267 : _M_t(_Pair_alloc_type(__a))
268 { _M_t._M_insert_range_unique(__l.begin(), __l.end()); }
271 template<
typename _InputIterator>
272 map(_InputIterator __first, _InputIterator __last,
273 const allocator_type& __a)
274 : _M_t(_Pair_alloc_type(__a))
275 { _M_t._M_insert_range_unique(__first, __last); }
288 template<
typename _InputIterator>
289 map(_InputIterator __first, _InputIterator __last)
291 { _M_t._M_insert_range_unique(__first, __last); }
305 template<
typename _InputIterator>
306 map(_InputIterator __first, _InputIterator __last,
307 const _Compare& __comp,
308 const allocator_type& __a = allocator_type())
309 : _M_t(__comp, _Pair_alloc_type(__a))
310 { _M_t._M_insert_range_unique(__first, __last); }
312#if __glibcxx_containers_ranges
317 template<__detail::__container_compatible_range<value_type> _Rg>
318 map(from_range_t, _Rg&& __rg,
319 const _Compare& __comp,
320 const _Alloc& __a = _Alloc())
321 : _M_t(__comp, _Pair_alloc_type(__a))
325 template<__detail::__container_compatible_range<value_type> _Rg>
326 map(from_range_t, _Rg&& __rg,
const _Alloc& __a = _Alloc())
327 : _M_t(_Pair_alloc_type(__a))
332#if __cplusplus >= 201103L
346#if __cplusplus < 201103L
375 _M_t._M_assign_unique(__l.begin(), __l.end());
383 {
return allocator_type(_M_t.get_allocator()); }
393 {
return _M_t.begin(); }
402 {
return _M_t.begin(); }
411 {
return _M_t.end(); }
419 end() const _GLIBCXX_NOEXCEPT
420 {
return _M_t.end(); }
429 {
return _M_t.rbegin(); }
436 const_reverse_iterator
438 {
return _M_t.rbegin(); }
447 {
return _M_t.rend(); }
454 const_reverse_iterator
456 {
return _M_t.rend(); }
458#if __cplusplus >= 201103L
466 {
return _M_t.begin(); }
475 {
return _M_t.end(); }
482 const_reverse_iterator
484 {
return _M_t.rbegin(); }
491 const_reverse_iterator
493 {
return _M_t.rend(); }
500 _GLIBCXX_NODISCARD
bool
502 {
return _M_t.empty(); }
507 {
return _M_t.size(); }
512 {
return _M_t.max_size(); }
531 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
536#if __cplusplus >= 201103L
541 __i =
insert(__i, value_type(__k, mapped_type()));
543 return (*__i).second;
546#if __cplusplus >= 201103L
551 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
559 return (*__i).second;
573 at(
const key_type& __k)
577 __throw_out_of_range(__N(
"map::at"));
578 return (*__i).second;
582 at(
const key_type& __k)
const
586 __throw_out_of_range(__N(
"map::at"));
587 return (*__i).second;
591#if __cplusplus >= 201103L
610 template<
typename... _Args>
614#if __cplusplus >= 201703L
615 if constexpr (
sizeof...(_Args) == 2)
618 auto&& [__a, __v] =
pair<_Args&...>(__args...);
619 if constexpr (__usable_key<
decltype(__a)>)
621 const key_type& __k = __a;
660 template<
typename... _Args>
664 return _M_t._M_emplace_hint_unique(__pos,
669#ifdef __glibcxx_node_extract
672 extract(const_iterator __pos)
674 __glibcxx_assert(__pos !=
end());
675 return _M_t.extract(__pos);
680 extract(
const key_type& __x)
681 {
return _M_t.extract(__x); }
683#ifdef __glibcxx_associative_heterogeneous_erasure
684 template <__heterogeneous_tree_key<map> _Kt>
687 {
return _M_t._M_extract_tr(__key); }
693 {
return _M_t._M_reinsert_node_unique(
std::move(__nh)); }
697 insert(const_iterator __hint, node_type&& __nh)
698 {
return _M_t._M_reinsert_node_hint_unique(__hint,
std::move(__nh)); }
700 template<
typename,
typename>
701 friend struct std::_Rb_tree_merge_helper;
703 template<
typename _Cmp2>
707 using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
708 _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
711 template<
typename _Cmp2>
716 template<
typename _Cmp2>
718 merge(multimap<_Key, _Tp, _Cmp2, _Alloc>& __source)
720 using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
721 _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
724 template<
typename _Cmp2>
726 merge(multimap<_Key, _Tp, _Cmp2, _Alloc>&& __source)
730#ifdef __glibcxx_map_try_emplace
751 template <
typename... _Args>
753 try_emplace(
const key_type& __k, _Args&&... __args)
768 template <
typename... _Args>
770 try_emplace(key_type&& __k, _Args&&... __args)
811 template <
typename... _Args>
813 try_emplace(const_iterator __hint,
const key_type& __k,
817 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
818 if (__true_hint.second)
825 __i = iterator(__true_hint.first);
830 template <
typename... _Args>
832 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
835 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
836 if (__true_hint.second)
843 __i = iterator(__true_hint.first);
866 {
return _M_t._M_insert_unique(__x); }
868#if __cplusplus >= 201103L
873 {
return _M_t._M_insert_unique(
std::move(__x)); }
875 template<
typename _Pair>
876 __enable_if_t<is_constructible<value_type, _Pair>::value,
880#if __cplusplus >= 201703L
882 if constexpr (__is_pair<remove_const_t<_P2>>)
884 if constexpr (__usable_key<typename _P2::first_type>)
886 const key_type& __k = __x.first;
901#if __cplusplus >= 201103L
911 {
insert(__list.begin(), __list.end()); }
914#if __glibcxx_containers_ranges
921 template<__detail::__container_compatible_range<value_type> _Rg>
923 insert_range(_Rg&& __rg)
925 auto __first = ranges::begin(__rg);
926 const auto __last = ranges::end(__rg);
927 for (; __first != __last; ++__first)
957#if __cplusplus >= 201103L
958 insert(const_iterator __position,
const value_type& __x)
960 insert(iterator __position,
const value_type& __x)
962 {
return _M_t._M_insert_unique_(__position, __x); }
964#if __cplusplus >= 201103L
968 insert(const_iterator __position, value_type&& __x)
969 {
return _M_t._M_insert_unique_(__position,
std::move(__x)); }
971 template<
typename _Pair>
972 __enable_if_t<is_constructible<value_type, _Pair>::value,
iterator>
973 insert(const_iterator __position, _Pair&& __x)
975 return _M_t._M_emplace_hint_unique(__position,
989 template<
typename _InputIterator>
991 insert(_InputIterator __first, _InputIterator __last)
992 { _M_t._M_insert_range_unique(__first, __last); }
994#if __cplusplus > 201402L
1014 template <
typename _Obj>
1019 if (__i ==
end() ||
key_comp()(__k, (*__i).first))
1028 return {__i,
false};
1032 template <
typename _Obj>
1037 if (__i ==
end() ||
key_comp()(__k, (*__i).first))
1046 return {__i,
false};
1069 template <
typename _Obj>
1072 const key_type& __k, _Obj&& __obj)
1075 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
1076 if (__true_hint.second)
1084 __i = iterator(__true_hint.first);
1090 template <
typename _Obj>
1095 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
1096 if (__true_hint.second)
1104 __i = iterator(__true_hint.first);
1110#if __cplusplus >= 201103L
1130 {
return _M_t.erase(__position); }
1133 _GLIBCXX_ABI_TAG_CXX11
1135 erase(iterator __position)
1136 {
return _M_t.erase(__position); }
1151 { _M_t.erase(__position); }
1168 {
return _M_t._M_erase_unique(__x); }
1170#ifdef __glibcxx_associative_heterogeneous_erasure
1174 template <__heterogeneous_tree_key<map> _Kt>
1177 {
return _M_t._M_erase_tr(__x); }
1181#if __cplusplus >= 201103L
1198 erase(const_iterator __first, const_iterator __last)
1199 {
return _M_t.erase(__first, __last); }
1215 { _M_t.erase(__first, __last); }
1233 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
1234 { _M_t.swap(__x._M_t); }
1253 {
return _M_t.key_comp(); }
1261 {
return value_compare(_M_t.key_comp()); }
1280 {
return _M_t.find(__x); }
1282#ifdef __glibcxx_generic_associative_lookup
1283 template<
typename _Kt>
1285 find(
const _Kt& __x) ->
decltype(_M_t._M_find_tr(__x))
1286 {
return _M_t._M_find_tr(__x); }
1305 {
return _M_t.find(__x); }
1307#ifdef __glibcxx_generic_associative_lookup
1308 template<
typename _Kt>
1310 find(
const _Kt& __x)
const ->
decltype(_M_t._M_find_tr(__x))
1311 {
return _M_t._M_find_tr(__x); }
1326 {
return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
1328#ifdef __glibcxx_generic_associative_lookup
1329 template<
typename _Kt>
1331 count(
const _Kt& __x)
const ->
decltype(_M_t._M_count_tr(__x))
1332 {
return _M_t._M_count_tr(__x); }
1336#if __cplusplus > 201703L
1345 {
return _M_t.find(__x) != _M_t.end(); }
1347 template<
typename _Kt>
1350 ->
decltype(_M_t._M_find_tr(__x),
void(),
true)
1351 {
return _M_t._M_find_tr(__x) != _M_t.end(); }
1369 {
return _M_t.lower_bound(__x); }
1371#ifdef __glibcxx_generic_associative_lookup
1372 template<
typename _Kt>
1375 ->
decltype(
iterator(_M_t._M_lower_bound_tr(__x)))
1376 {
return iterator(_M_t._M_lower_bound_tr(__x)); }
1394 {
return _M_t.lower_bound(__x); }
1396#ifdef __glibcxx_generic_associative_lookup
1397 template<
typename _Kt>
1400 ->
decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
1401 {
return const_iterator(_M_t._M_lower_bound_tr(__x)); }
1414 {
return _M_t.upper_bound(__x); }
1416#ifdef __glibcxx_generic_associative_lookup
1417 template<
typename _Kt>
1420 ->
decltype(
iterator(_M_t._M_upper_bound_tr(__x)))
1421 {
return iterator(_M_t._M_upper_bound_tr(__x)); }
1434 {
return _M_t.upper_bound(__x); }
1436#ifdef __glibcxx_generic_associative_lookup
1437 template<
typename _Kt>
1440 ->
decltype(const_iterator(_M_t._M_upper_bound_tr(__x)))
1441 {
return const_iterator(_M_t._M_upper_bound_tr(__x)); }
1463 {
return _M_t.equal_range(__x); }
1465#ifdef __glibcxx_generic_associative_lookup
1466 template<
typename _Kt>
1492 {
return _M_t.equal_range(__x); }
1494#ifdef __glibcxx_generic_associative_lookup
1495 template<
typename _Kt>
1499 _M_t._M_equal_range_tr(__x)))
1502 _M_t._M_equal_range_tr(__x));
1507 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1509 operator==(
const map<_K1, _T1, _C1, _A1>&,
1510 const map<_K1, _T1, _C1, _A1>&);
1512#if __cpp_lib_three_way_comparison
1513 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1514 friend __detail::__synth3way_t<pair<const _K1, _T1>>
1515 operator<=>(
const map<_K1, _T1, _C1, _A1>&,
1516 const map<_K1, _T1, _C1, _A1>&);
1518 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1520 operator<(
const map<_K1, _T1, _C1, _A1>&,
1521 const map<_K1, _T1, _C1, _A1>&);
1526#if __cpp_deduction_guides >= 201606
1528 template<
typename _InputIterator,
1531 typename = _RequireInputIter<_InputIterator>,
1532 typename = _RequireNotAllocator<_Compare>,
1533 typename = _RequireAllocator<_Allocator>>
1534 map(_InputIterator, _InputIterator,
1535 _Compare = _Compare(), _Allocator = _Allocator())
1537 _Compare, _Allocator>;
1539 template<
typename _Key,
typename _Tp,
typename _Compare = less<_Key>,
1540 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1541 typename = _RequireNotAllocator<_Compare>,
1542 typename = _RequireAllocator<_Allocator>>
1544 _Compare = _Compare(), _Allocator = _Allocator())
1547 template <
typename _InputIterator,
typename _Allocator,
1548 typename = _RequireInputIter<_InputIterator>,
1549 typename = _RequireAllocator<_Allocator>>
1550 map(_InputIterator, _InputIterator, _Allocator)
1554 template<
typename _Key,
typename _Tp,
typename _Allocator,
1555 typename = _RequireAllocator<_Allocator>>
1559#if __glibcxx_containers_ranges
1562 __allocator_like _Alloc =
1563 std::allocator<__detail::__range_to_alloc_type<_Rg>>>
1564 map(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc())
1566 __detail::__range_mapped_type<_Rg>,
1569 template<ranges::input_range _Rg, __allocator_like _Alloc>
1570 map(from_range_t, _Rg&&, _Alloc)
1572 __detail::__range_mapped_type<_Rg>,
1589 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1593 {
return __x._M_t == __y._M_t; }
1595#if __cpp_lib_three_way_comparison
1610 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1611 inline __detail::__synth3way_t<pair<const _Key, _Tp>>
1612 operator<=>(
const map<_Key, _Tp, _Compare, _Alloc>& __x,
1613 const map<_Key, _Tp, _Compare, _Alloc>& __y)
1614 {
return __x._M_t <=> __y._M_t; }
1627 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1631 {
return __x._M_t < __y._M_t; }
1634 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1638 {
return !(__x == __y); }
1641 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1645 {
return __y < __x; }
1648 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1652 {
return !(__y < __x); }
1655 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1659 {
return !(__x < __y); }
1663 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1667 _GLIBCXX_NOEXCEPT_IF(
noexcept(__x.
swap(__y)))
1670_GLIBCXX_END_NAMESPACE_CONTAINER
1672#ifdef __glibcxx_node_extract
1674 template<
typename _Key,
typename _Val,
typename _Cmp1,
typename _Alloc,
1677 _Rb_tree_merge_helper<_GLIBCXX_STD_C::map<_Key, _Val, _Cmp1, _Alloc>,
1681 friend class _GLIBCXX_STD_C::map<_Key, _Val, _Cmp1, _Alloc>;
1684 _S_get_tree(_GLIBCXX_STD_C::map<_Key, _Val, _Cmp2, _Alloc>& __map)
1685 {
return __map._M_t; }
1688 _S_get_tree(_GLIBCXX_STD_C::multimap<_Key, _Val, _Cmp2, _Alloc>& __map)
1689 {
return __map._M_t; }
1693_GLIBCXX_END_NAMESPACE_VERSION
typename remove_reference< _Tp >::type remove_reference_t
Alias template for remove_reference.
pair(_T1, _T2) -> pair< _T1, _T2 >
Two pairs are equal iff their members are equal.
constexpr tuple< _Elements &&... > forward_as_tuple(_Elements &&... __args) noexcept
Create a tuple of lvalue or rvalue references to the arguments.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr piecewise_construct_t piecewise_construct
Tag for piecewise construction of std::pair objects.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
ISO C++ entities toplevel namespace is std.
Primary class template, tuple.
is_nothrow_copy_constructible
The standard allocator, as per C++03 [20.4.1].
One of the comparison functors.
Struct holding two objects of arbitrary type.
_T1 first
The first member.
constexpr void swap(pair &__p) noexcept(__and_< __is_nothrow_swappable< _T1 >, __is_nothrow_swappable< _T2 > >::value)
Swap the first members and then the second members.
A standard container made up of (key,value) pairs, which can be retrieved based on a key,...
A standard container made up of (key,value) pairs, which can be retrieved based on a key,...
iterator emplace_hint(const_iterator __pos, _Args &&... __args)
Attempts to build and insert a std::pair into the map.
const_iterator find(const key_type &__x) const
Tries to locate an element in a map.
map(_InputIterator __first, _InputIterator __last, const allocator_type &__a)
Allocator-extended range constructor.
__enable_if_t< is_constructible< value_type, _Pair >::value, iterator > insert(const_iterator __position, _Pair &&__x)
Attempts to insert a std::pair into the map.
bool empty() const noexcept
const_reverse_iterator rend() const noexcept
bool contains(const key_type &__x) const
Finds whether an element with the given key exists.
map(const map &__m, const __type_identity_t< allocator_type > &__a)
Allocator-extended copy constructor.
value_compare value_comp() const
void insert(_InputIterator __first, _InputIterator __last)
Template function that attempts to insert a range of elements.
iterator upper_bound(const key_type &__x)
Finds the end of a subsequence matching given key.
std::pair< iterator, iterator > equal_range(const key_type &__x)
Finds a subsequence matching given key.
map(initializer_list< value_type > __l, const _Compare &__comp=_Compare(), const allocator_type &__a=allocator_type())
Builds a map from an initializer_list.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert a std::pair into the map.
map(map &&)=default
Map move constructor.
size_type count(const key_type &__x) const
Finds the number of elements with given key.
const_reverse_iterator rbegin() const noexcept
reverse_iterator rbegin() noexcept
iterator insert_or_assign(const_iterator __hint, const key_type &__k, _Obj &&__obj)
Attempts to insert or assign a std::pair into the map.
const_iterator end() const noexcept
const_iterator cend() const noexcept
mapped_type & at(const key_type &__k)
Access to map data.
key_compare key_comp() const
map(map &&__m, const __type_identity_t< allocator_type > &__a) noexcept(is_nothrow_copy_constructible< _Compare >::value &&_Alloc_traits::_S_always_equal())
Allocator-extended move constructor.
map(_InputIterator __first, _InputIterator __last)
Builds a map from a range.
const_reverse_iterator crbegin() const noexcept
pair< iterator, bool > insert_or_assign(const key_type &__k, _Obj &&__obj)
Attempts to insert or assign a std::pair into the map.
void swap(map &__x) noexcept(/*conditional */)
Swaps data with another map.
size_type erase(const key_type &__x)
Erases elements according to the provided key.
map(initializer_list< value_type > __l, const allocator_type &__a)
Allocator-extended initialier-list constructor.
map(const map &)=default
Map copy constructor.
map(const allocator_type &__a)
Allocator-extended default constructor.
iterator insert(const_iterator __position, value_type &&__x)
Attempts to insert a std::pair into the map.
iterator insert(const_iterator __position, const value_type &__x)
Attempts to insert a std::pair into the map.
map(const _Compare &__comp, const allocator_type &__a=allocator_type())
Creates a map with no elements.
reverse_iterator rend() noexcept
iterator erase(const_iterator __first, const_iterator __last)
Erases a [first,last) range of elements from a map.
void insert(std::initializer_list< value_type > __list)
Attempts to insert a list of std::pairs into the map.
map & operator=(const map &)=default
Map assignment operator.
const_iterator lower_bound(const key_type &__x) const
Finds the beginning of a subsequence matching given key.
size_type size() const noexcept
std::pair< const_iterator, const_iterator > equal_range(const key_type &__x) const
Finds a subsequence matching given key.
iterator find(const key_type &__x)
Tries to locate an element in a map.
map(_InputIterator __first, _InputIterator __last, const _Compare &__comp, const allocator_type &__a=allocator_type())
Builds a map from a range.
__enable_if_t< is_constructible< value_type, _Pair >::value, pair< iterator, bool > > insert(_Pair &&__x)
Attempts to insert a std::pair into the map.
iterator erase(const_iterator __position)
Erases an element from a map.
mapped_type & operator[](const key_type &__k)
Subscript ( [] ) access to map data.
auto contains(const _Kt &__x) const -> decltype(_M_t._M_find_tr(__x), void(), true)
Finds whether an element with the given key exists.
iterator lower_bound(const key_type &__x)
Finds the beginning of a subsequence matching given key.
const_reverse_iterator crend() const noexcept
allocator_type get_allocator() const noexcept
Get a copy of the memory allocation object.
map & operator=(initializer_list< value_type > __l)
Map list assignment operator.
std::pair< iterator, bool > emplace(_Args &&... __args)
Attempts to build and insert a std::pair into the map.
const_iterator cbegin() const noexcept
size_type max_size() const noexcept
const_iterator begin() const noexcept
iterator begin() noexcept
map & operator=(map &&)=default
Move assignment operator.
std::pair< iterator, bool > insert(value_type &&__x)
Attempts to insert a std::pair into the map.
map()=default
Default constructor creates no elements.
const_iterator upper_bound(const key_type &__x) const
Finds the end of a subsequence matching given key.
Uniform interface to C++98 and C++11 allocators.
A range for which ranges::begin returns an input iterator.