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(); }
534 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
539#if __cplusplus >= 201103L
544 __i =
insert(__i, value_type(__k, mapped_type()));
546 return (*__i).second;
549#if __cplusplus >= 201103L
554 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
562 return (*__i).second;
566#ifdef __glibcxx_associative_heterogeneous_insertion
567 template <__heterogeneous_tree_key<map> _Kt>
586 at(
const key_type& __k)
590 __throw_out_of_range(__N(
"map::at"));
591 return (*__i).second;
594#ifdef __glibcxx_associative_heterogeneous_insertion
595 template <__heterogeneous_tree_key<map> _Kt>
601 __throw_out_of_range(__N(
"map::at"));
602 return (*__i).second;
607 at(
const key_type& __k)
const
611 __throw_out_of_range(__N(
"map::at"));
612 return (*__i).second;
615#ifdef __glibcxx_associative_heterogeneous_insertion
616 template <__heterogeneous_tree_key<map> _Kt>
618 at(
const _Kt& __k)
const
622 __throw_out_of_range(__N(
"map::at"));
623 return (*__i).second;
628#if __cplusplus >= 201103L
647 template<
typename... _Args>
651#if __cplusplus >= 201703L
652 if constexpr (
sizeof...(_Args) == 2)
655 auto&& [__a, __v] =
pair<_Args&...>(__args...);
656 if constexpr (__usable_key<
decltype(__a)>)
658 const key_type& __k = __a;
697 template<
typename... _Args>
701 return _M_t._M_emplace_hint_unique(__pos,
706#ifdef __glibcxx_node_extract
709 extract(const_iterator __pos)
711 __glibcxx_assert(__pos !=
end());
712 return _M_t.extract(__pos);
717 extract(
const key_type& __x)
718 {
return _M_t.extract(__x); }
720#ifdef __glibcxx_associative_heterogeneous_erasure
721 template <__heterogeneous_tree_key<map> _Kt>
724 {
return _M_t._M_extract_tr(__key); }
730 {
return _M_t._M_reinsert_node_unique(
std::move(__nh)); }
734 insert(const_iterator __hint, node_type&& __nh)
735 {
return _M_t._M_reinsert_node_hint_unique(__hint,
std::move(__nh)); }
737 template<
typename,
typename>
738 friend struct std::_Rb_tree_merge_helper;
740 template<
typename _Cmp2>
744 using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
745 _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
748 template<
typename _Cmp2>
753 template<
typename _Cmp2>
755 merge(multimap<_Key, _Tp, _Cmp2, _Alloc>& __source)
757 using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
758 _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
761 template<
typename _Cmp2>
763 merge(multimap<_Key, _Tp, _Cmp2, _Alloc>&& __source)
767#ifdef __glibcxx_map_try_emplace
791 template <
typename... _Args>
793 try_emplace(
const key_type& __k, _Args&&... __args)
808 template <
typename... _Args>
810 try_emplace(key_type&& __k, _Args&&... __args)
824#ifdef __glibcxx_associative_heterogeneous_insertion
825 template <__heterogeneous_tree_key<map> _Kt,
typename ..._Args>
827 try_emplace(_Kt&& __k, _Args&&... __args)
830 auto [__left, __node] = _M_t._M_get_insert_unique_pos_tr(__k);
833 __i = _M_t._M_emplace_here(__left == __node, __node,
837 return { __i,
true };
839 __i = iterator(__left);
840 return { __i,
false };
876 template <
typename... _Args>
878 try_emplace(const_iterator __hint,
const key_type& __k,
882 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
883 if (__true_hint.second)
890 __i = iterator(__true_hint.first);
895 template <
typename... _Args>
897 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
900 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
901 if (__true_hint.second)
908 __i = iterator(__true_hint.first);
912#ifdef __glibcxx_associative_heterogeneous_insertion
913 template <__heterogeneous_tree_key<map> _Kt,
typename ..._Args>
915 try_emplace(const_iterator __hint, _Kt&& __k, _Args&&... __args)
918 auto [__left, __node] =
919 _M_t._M_get_insert_hint_unique_pos_tr(__hint, __k);
922 __i = _M_t._M_emplace_here(__left == __node, __node,
927 else __i = iterator(__left);
952 {
return _M_t._M_insert_unique(__x); }
954#if __cplusplus >= 201103L
959 {
return _M_t._M_insert_unique(
std::move(__x)); }
961 template<
typename _Pair>
962 __enable_if_t<is_constructible<value_type, _Pair>::value,
966#if __cplusplus >= 201703L
968 if constexpr (__is_pair<remove_const_t<_P2>>)
970 if constexpr (__usable_key<typename _P2::first_type>)
972 const key_type& __k = __x.first;
987#if __cplusplus >= 201103L
997 {
insert(__list.begin(), __list.end()); }
1000#if __glibcxx_containers_ranges
1007 template<__detail::__container_compatible_range<value_type> _Rg>
1009 insert_range(_Rg&& __rg)
1011 auto __first = ranges::begin(__rg);
1012 const auto __last = ranges::end(__rg);
1013 for (; __first != __last; ++__first)
1043#if __cplusplus >= 201103L
1044 insert(const_iterator __position,
const value_type& __x)
1046 insert(iterator __position,
const value_type& __x)
1048 {
return _M_t._M_insert_unique_(__position, __x); }
1050#if __cplusplus >= 201103L
1054 insert(const_iterator __position, value_type&& __x)
1055 {
return _M_t._M_insert_unique_(__position,
std::move(__x)); }
1057 template<
typename _Pair>
1058 __enable_if_t<is_constructible<value_type, _Pair>::value,
iterator>
1059 insert(const_iterator __position, _Pair&& __x)
1061 return _M_t._M_emplace_hint_unique(__position,
1075 template<
typename _InputIterator>
1077 insert(_InputIterator __first, _InputIterator __last)
1078 { _M_t._M_insert_range_unique(__first, __last); }
1080#ifdef __glibcxx_map_try_emplace
1101 template <
typename _Obj>
1103 insert_or_assign(
const key_type& __k, _Obj&& __obj)
1106 if (__i ==
end() ||
key_comp()(__k, (*__i).first))
1115 return {__i,
false};
1119 template <
typename _Obj>
1121 insert_or_assign(key_type&& __k, _Obj&& __obj)
1124 if (__i ==
end() ||
key_comp()(__k, (*__i).first))
1133 return {__i,
false};
1136#ifdef __glibcxx_associative_heterogeneous_insertion
1137 template <__heterogeneous_tree_key<map> _Kt,
typename _Obj>
1139 insert_or_assign(_Kt&& __k, _Obj&& __obj)
1142 auto [__left, __node] =_M_t._M_get_insert_unique_pos_tr(__k);
1145 __i = _M_t._M_emplace_here(__left == __node, __node,
1149 return { __i,
true };
1151 __i = iterator(__left);
1153 return { __i,
false };
1182 template <
typename _Obj>
1184 insert_or_assign(const_iterator __hint,
1185 const key_type& __k, _Obj&& __obj)
1188 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
1189 if (__true_hint.second)
1197 __i = iterator(__true_hint.first);
1203 template <
typename _Obj>
1205 insert_or_assign(const_iterator __hint, key_type&& __k, _Obj&& __obj)
1208 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
1209 if (__true_hint.second)
1217 __i = iterator(__true_hint.first);
1222#ifdef __glibcxx_associative_heterogeneous_insertion
1223 template <__heterogeneous_tree_key<map> _Kt,
typename _Obj>
1225 insert_or_assign(const_iterator __hint, _Kt&& __k, _Obj&& __obj)
1228 auto [__left, __node] =
1229 _M_t._M_get_insert_hint_unique_pos_tr(__hint, __k);
1232 return _M_t._M_emplace_here(__left == __node, __node,
1237 __i = iterator(__left);
1245#if __cplusplus >= 201103L
1265 {
return _M_t.erase(__position); }
1268 _GLIBCXX_ABI_TAG_CXX11
1271 {
return _M_t.erase(__position); }
1286 { _M_t.erase(__position); }
1303 {
return _M_t._M_erase_unique(__x); }
1305#ifdef __glibcxx_associative_heterogeneous_erasure
1309 template <__heterogeneous_tree_key<map> _Kt>
1312 {
return _M_t._M_erase_tr(__x); }
1316#if __cplusplus >= 201103L
1333 erase(const_iterator __first, const_iterator __last)
1334 {
return _M_t.erase(__first, __last); }
1350 { _M_t.erase(__first, __last); }
1368 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
1369 { _M_t.swap(__x._M_t); }
1388 {
return _M_t.key_comp(); }
1396 {
return value_compare(_M_t.key_comp()); }
1415 {
return _M_t.find(__x); }
1417#ifdef __glibcxx_generic_associative_lookup
1418 template<
typename _Kt>
1420 find(
const _Kt& __x) ->
decltype(_M_t._M_find_tr(__x))
1421 {
return _M_t._M_find_tr(__x); }
1440 {
return _M_t.find(__x); }
1442#ifdef __glibcxx_generic_associative_lookup
1443 template<
typename _Kt>
1445 find(
const _Kt& __x)
const ->
decltype(_M_t._M_find_tr(__x))
1446 {
return _M_t._M_find_tr(__x); }
1461 {
return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
1463#ifdef __glibcxx_generic_associative_lookup
1464 template<
typename _Kt>
1466 count(
const _Kt& __x)
const ->
decltype(_M_t._M_count_tr(__x))
1467 {
return _M_t._M_count_tr(__x); }
1471#if __cplusplus > 201703L
1480 {
return _M_t.find(__x) != _M_t.end(); }
1482 template<
typename _Kt>
1485 ->
decltype(_M_t._M_find_tr(__x),
void(),
true)
1486 {
return _M_t._M_find_tr(__x) != _M_t.end(); }
1504 {
return _M_t.lower_bound(__x); }
1506#ifdef __glibcxx_generic_associative_lookup
1507 template<
typename _Kt>
1510 ->
decltype(
iterator(_M_t._M_lower_bound_tr(__x)))
1511 {
return iterator(_M_t._M_lower_bound_tr(__x)); }
1529 {
return _M_t.lower_bound(__x); }
1531#ifdef __glibcxx_generic_associative_lookup
1532 template<
typename _Kt>
1535 ->
decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
1536 {
return const_iterator(_M_t._M_lower_bound_tr(__x)); }
1549 {
return _M_t.upper_bound(__x); }
1551#ifdef __glibcxx_generic_associative_lookup
1552 template<
typename _Kt>
1555 ->
decltype(
iterator(_M_t._M_upper_bound_tr(__x)))
1556 {
return iterator(_M_t._M_upper_bound_tr(__x)); }
1569 {
return _M_t.upper_bound(__x); }
1571#ifdef __glibcxx_generic_associative_lookup
1572 template<
typename _Kt>
1575 ->
decltype(const_iterator(_M_t._M_upper_bound_tr(__x)))
1576 {
return const_iterator(_M_t._M_upper_bound_tr(__x)); }
1598 {
return _M_t.equal_range(__x); }
1600#ifdef __glibcxx_generic_associative_lookup
1601 template<
typename _Kt>
1627 {
return _M_t.equal_range(__x); }
1629#ifdef __glibcxx_generic_associative_lookup
1630 template<
typename _Kt>
1634 _M_t._M_equal_range_tr(__x)))
1637 _M_t._M_equal_range_tr(__x));
1642 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1644 operator==(
const map<_K1, _T1, _C1, _A1>&,
1645 const map<_K1, _T1, _C1, _A1>&);
1647#if __cpp_lib_three_way_comparison
1648 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1649 friend __detail::__synth3way_t<pair<const _K1, _T1>>
1650 operator<=>(
const map<_K1, _T1, _C1, _A1>&,
1651 const map<_K1, _T1, _C1, _A1>&);
1653 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1655 operator<(
const map<_K1, _T1, _C1, _A1>&,
1656 const map<_K1, _T1, _C1, _A1>&);
1661#if __cpp_deduction_guides >= 201606
1663 template<
typename _InputIterator,
1666 typename = _RequireInputIter<_InputIterator>,
1667 typename = _RequireNotAllocator<_Compare>,
1668 typename = _RequireAllocator<_Allocator>>
1669 map(_InputIterator, _InputIterator,
1670 _Compare = _Compare(), _Allocator = _Allocator())
1672 _Compare, _Allocator>;
1674 template<
typename _Key,
typename _Tp,
typename _Compare = less<_Key>,
1675 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1676 typename = _RequireNotAllocator<_Compare>,
1677 typename = _RequireAllocator<_Allocator>>
1679 _Compare = _Compare(), _Allocator = _Allocator())
1682 template <
typename _InputIterator,
typename _Allocator,
1683 typename = _RequireInputIter<_InputIterator>,
1684 typename = _RequireAllocator<_Allocator>>
1685 map(_InputIterator, _InputIterator, _Allocator)
1689 template<
typename _Key,
typename _Tp,
typename _Allocator,
1690 typename = _RequireAllocator<_Allocator>>
1694#if __glibcxx_containers_ranges
1697 __allocator_like _Alloc =
1698 std::allocator<__detail::__range_to_alloc_type<_Rg>>>
1699 map(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc())
1701 __detail::__range_mapped_type<_Rg>,
1704 template<ranges::input_range _Rg, __allocator_like _Alloc>
1705 map(from_range_t, _Rg&&, _Alloc)
1707 __detail::__range_mapped_type<_Rg>,
1724 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1728 {
return __x._M_t == __y._M_t; }
1730#if __cpp_lib_three_way_comparison
1745 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1746 inline __detail::__synth3way_t<pair<const _Key, _Tp>>
1747 operator<=>(
const map<_Key, _Tp, _Compare, _Alloc>& __x,
1748 const map<_Key, _Tp, _Compare, _Alloc>& __y)
1749 {
return __x._M_t <=> __y._M_t; }
1762 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1766 {
return __x._M_t < __y._M_t; }
1769 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1773 {
return !(__x == __y); }
1776 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1780 {
return __y < __x; }
1783 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1787 {
return !(__y < __x); }
1790 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1794 {
return !(__x < __y); }
1798 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1802 _GLIBCXX_NOEXCEPT_IF(
noexcept(__x.
swap(__y)))
1805_GLIBCXX_END_NAMESPACE_CONTAINER
1807#ifdef __glibcxx_node_extract
1809 template<
typename _Key,
typename _Val,
typename _Cmp1,
typename _Alloc,
1812 _Rb_tree_merge_helper<_GLIBCXX_STD_C::map<_Key, _Val, _Cmp1, _Alloc>,
1816 friend class _GLIBCXX_STD_C::map<_Key, _Val, _Cmp1, _Alloc>;
1819 _S_get_tree(_GLIBCXX_STD_C::map<_Key, _Val, _Cmp2, _Alloc>& __map)
1820 {
return __map._M_t; }
1823 _S_get_tree(_GLIBCXX_STD_C::multimap<_Key, _Val, _Cmp2, _Alloc>& __map)
1824 {
return __map._M_t; }
1828_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 (or references) 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
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
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.
iterator erase(iterator __position)
Erases an element from a map.
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.
size_type erase(_Kt &&__x)
Erases elements according to the provided key.
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.