61#if __cplusplus >= 201103L
65#if __glibcxx_containers_ranges
69namespace std _GLIBCXX_VISIBILITY(default)
71_GLIBCXX_BEGIN_NAMESPACE_VERSION
72_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
74 template <
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
103 template <
typename _Key,
typename _Tp,
typename _Compare = std::less<_Key>,
104 typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
108 typedef _Key key_type;
109 typedef _Tp mapped_type;
111 typedef _Compare key_compare;
112 typedef _Alloc allocator_type;
115#ifdef _GLIBCXX_CONCEPT_CHECKS
117 typedef typename _Alloc::value_type _Alloc_value_type;
118# if __cplusplus < 201103L
119 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
121 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
122 _BinaryFunctionConcept)
123 __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
126#if __cplusplus >= 201103L
127#if __cplusplus > 201703L || defined __STRICT_ANSI__
129 "std::map must have the same value_type as its allocator");
134#pragma GCC diagnostic push
135#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
139 friend class map<_Key, _Tp, _Compare, _Alloc>;
143 value_compare(_Compare __c)
147 bool operator()(
const value_type& __x,
const value_type& __y)
const
150#pragma GCC diagnostic pop
155 rebind<value_type>::other _Pair_alloc_type;
157 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
158 key_compare, _Pair_alloc_type> _Rep_type;
165#if __cplusplus >= 201703L
166 template<
typename _Up,
typename _Vp = remove_reference_t<_Up>>
167 static constexpr bool __usable_key
168 = __or_v<is_same<const _Vp, const _Key>,
175 typedef typename _Alloc_traits::pointer pointer;
176 typedef typename _Alloc_traits::const_pointer const_pointer;
177 typedef typename _Alloc_traits::reference reference;
178 typedef typename _Alloc_traits::const_reference const_reference;
179 typedef typename _Rep_type::iterator iterator;
180 typedef typename _Rep_type::const_iterator const_iterator;
181 typedef typename _Rep_type::size_type size_type;
182 typedef typename _Rep_type::difference_type difference_type;
183 typedef typename _Rep_type::reverse_iterator reverse_iterator;
184 typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator;
186#ifdef __glibcxx_node_extract
187 using node_type =
typename _Rep_type::node_type;
188 using insert_return_type =
typename _Rep_type::insert_return_type;
197#if __cplusplus < 201103L
209 map(
const _Compare& __comp,
210 const allocator_type& __a = allocator_type())
211 : _M_t(__comp, _Pair_alloc_type(__a)) { }
218#if __cplusplus < 201103L
244 const _Compare& __comp = _Compare(),
245 const allocator_type& __a = allocator_type())
246 : _M_t(__comp, _Pair_alloc_type(__a))
247 { _M_t._M_insert_range_unique(__l.begin(), __l.end()); }
251 map(
const allocator_type& __a)
252 : _M_t(_Pair_alloc_type(__a)) { }
255 map(
const map& __m,
const __type_identity_t<allocator_type>& __a)
256 : _M_t(__m._M_t, _Pair_alloc_type(__a)) { }
259 map(
map&& __m,
const __type_identity_t<allocator_type>& __a)
261 && _Alloc_traits::_S_always_equal())
262 : _M_t(
std::
move(__m._M_t), _Pair_alloc_type(__a)) { }
266 : _M_t(_Pair_alloc_type(__a))
267 { _M_t._M_insert_range_unique(__l.begin(), __l.end()); }
270 template<
typename _InputIterator>
271 map(_InputIterator __first, _InputIterator __last,
272 const allocator_type& __a)
273 : _M_t(_Pair_alloc_type(__a))
274 { _M_t._M_insert_range_unique(__first, __last); }
287 template<
typename _InputIterator>
288 map(_InputIterator __first, _InputIterator __last)
290 { _M_t._M_insert_range_unique(__first, __last); }
304 template<
typename _InputIterator>
305 map(_InputIterator __first, _InputIterator __last,
306 const _Compare& __comp,
307 const allocator_type& __a = allocator_type())
308 : _M_t(__comp, _Pair_alloc_type(__a))
309 { _M_t._M_insert_range_unique(__first, __last); }
311#if __glibcxx_containers_ranges
316 template<__detail::__container_compatible_range<value_type> _Rg>
317 map(from_range_t, _Rg&& __rg,
318 const _Compare& __comp,
319 const _Alloc& __a = _Alloc())
320 : _M_t(__comp, _Pair_alloc_type(__a))
324 template<__detail::__container_compatible_range<value_type> _Rg>
325 map(from_range_t, _Rg&& __rg,
const _Alloc& __a = _Alloc())
326 : _M_t(_Pair_alloc_type(__a))
331#if __cplusplus >= 201103L
345#if __cplusplus < 201103L
374 _M_t._M_assign_unique(__l.begin(), __l.end());
382 {
return allocator_type(_M_t.get_allocator()); }
392 {
return _M_t.begin(); }
401 {
return _M_t.begin(); }
410 {
return _M_t.end(); }
418 end() const _GLIBCXX_NOEXCEPT
419 {
return _M_t.end(); }
428 {
return _M_t.rbegin(); }
435 const_reverse_iterator
437 {
return _M_t.rbegin(); }
446 {
return _M_t.rend(); }
453 const_reverse_iterator
455 {
return _M_t.rend(); }
457#if __cplusplus >= 201103L
465 {
return _M_t.begin(); }
474 {
return _M_t.end(); }
481 const_reverse_iterator
483 {
return _M_t.rbegin(); }
490 const_reverse_iterator
492 {
return _M_t.rend(); }
499 _GLIBCXX_NODISCARD
bool
501 {
return _M_t.empty(); }
506 {
return _M_t.size(); }
511 {
return _M_t.max_size(); }
530 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
535#if __cplusplus >= 201103L
540 __i =
insert(__i, value_type(__k, mapped_type()));
542 return (*__i).second;
545#if __cplusplus >= 201103L
550 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
558 return (*__i).second;
572 at(
const key_type& __k)
576 __throw_out_of_range(__N(
"map::at"));
577 return (*__i).second;
581 at(
const key_type& __k)
const
585 __throw_out_of_range(__N(
"map::at"));
586 return (*__i).second;
590#if __cplusplus >= 201103L
609 template<
typename... _Args>
613#if __cplusplus >= 201703L
614 if constexpr (
sizeof...(_Args) == 2)
617 auto&& [__a, __v] =
pair<_Args&...>(__args...);
618 if constexpr (__usable_key<
decltype(__a)>)
620 const key_type& __k = __a;
659 template<
typename... _Args>
663 return _M_t._M_emplace_hint_unique(__pos,
668#ifdef __glibcxx_node_extract
671 extract(const_iterator __pos)
673 __glibcxx_assert(__pos !=
end());
674 return _M_t.extract(__pos);
679 extract(
const key_type& __x)
680 {
return _M_t.extract(__x); }
685 {
return _M_t._M_reinsert_node_unique(
std::move(__nh)); }
689 insert(const_iterator __hint, node_type&& __nh)
690 {
return _M_t._M_reinsert_node_hint_unique(__hint,
std::move(__nh)); }
692 template<
typename,
typename>
693 friend struct std::_Rb_tree_merge_helper;
695 template<
typename _Cmp2>
699 using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
700 _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
703 template<
typename _Cmp2>
708 template<
typename _Cmp2>
710 merge(multimap<_Key, _Tp, _Cmp2, _Alloc>& __source)
712 using _Merge_helper = _Rb_tree_merge_helper<map, _Cmp2>;
713 _M_t._M_merge_unique(_Merge_helper::_S_get_tree(__source));
716 template<
typename _Cmp2>
718 merge(multimap<_Key, _Tp, _Cmp2, _Alloc>&& __source)
722#ifdef __glibcxx_map_try_emplace
743 template <
typename... _Args>
745 try_emplace(
const key_type& __k, _Args&&... __args)
760 template <
typename... _Args>
762 try_emplace(key_type&& __k, _Args&&... __args)
803 template <
typename... _Args>
805 try_emplace(const_iterator __hint,
const key_type& __k,
809 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
810 if (__true_hint.second)
817 __i = iterator(__true_hint.first);
822 template <
typename... _Args>
824 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
827 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
828 if (__true_hint.second)
835 __i = iterator(__true_hint.first);
858 {
return _M_t._M_insert_unique(__x); }
860#if __cplusplus >= 201103L
865 {
return _M_t._M_insert_unique(
std::move(__x)); }
867 template<
typename _Pair>
868 __enable_if_t<is_constructible<value_type, _Pair>::value,
872#if __cplusplus >= 201703L
874 if constexpr (__is_pair<remove_const_t<_P2>>)
876 if constexpr (__usable_key<typename _P2::first_type>)
878 const key_type& __k = __x.first;
893#if __cplusplus >= 201103L
903 {
insert(__list.begin(), __list.end()); }
906#if __glibcxx_containers_ranges
913 template<__detail::__container_compatible_range<value_type> _Rg>
915 insert_range(_Rg&& __rg)
917 auto __first = ranges::begin(__rg);
918 const auto __last = ranges::end(__rg);
919 for (; __first != __last; ++__first)
949#if __cplusplus >= 201103L
950 insert(const_iterator __position,
const value_type& __x)
952 insert(iterator __position,
const value_type& __x)
954 {
return _M_t._M_insert_unique_(__position, __x); }
956#if __cplusplus >= 201103L
960 insert(const_iterator __position, value_type&& __x)
961 {
return _M_t._M_insert_unique_(__position,
std::move(__x)); }
963 template<
typename _Pair>
964 __enable_if_t<is_constructible<value_type, _Pair>::value,
iterator>
965 insert(const_iterator __position, _Pair&& __x)
967 return _M_t._M_emplace_hint_unique(__position,
981 template<
typename _InputIterator>
983 insert(_InputIterator __first, _InputIterator __last)
984 { _M_t._M_insert_range_unique(__first, __last); }
986#if __cplusplus > 201402L
1006 template <
typename _Obj>
1011 if (__i ==
end() ||
key_comp()(__k, (*__i).first))
1020 return {__i,
false};
1024 template <
typename _Obj>
1029 if (__i ==
end() ||
key_comp()(__k, (*__i).first))
1038 return {__i,
false};
1061 template <
typename _Obj>
1064 const key_type& __k, _Obj&& __obj)
1067 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
1068 if (__true_hint.second)
1076 __i = iterator(__true_hint.first);
1082 template <
typename _Obj>
1087 auto __true_hint = _M_t._M_get_insert_hint_unique_pos(__hint, __k);
1088 if (__true_hint.second)
1096 __i = iterator(__true_hint.first);
1102#if __cplusplus >= 201103L
1122 {
return _M_t.erase(__position); }
1125 _GLIBCXX_ABI_TAG_CXX11
1127 erase(iterator __position)
1128 {
return _M_t.erase(__position); }
1143 { _M_t.erase(__position); }
1159 {
return _M_t._M_erase_unique(__x); }
1161#if __cplusplus >= 201103L
1178 erase(const_iterator __first, const_iterator __last)
1179 {
return _M_t.erase(__first, __last); }
1195 { _M_t.erase(__first, __last); }
1213 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
1214 { _M_t.swap(__x._M_t); }
1233 {
return _M_t.key_comp(); }
1241 {
return value_compare(_M_t.key_comp()); }
1260 {
return _M_t.find(__x); }
1262#if __cplusplus > 201103L
1263 template<
typename _Kt>
1265 find(
const _Kt& __x) ->
decltype(_M_t._M_find_tr(__x))
1266 {
return _M_t._M_find_tr(__x); }
1285 {
return _M_t.find(__x); }
1287#if __cplusplus > 201103L
1288 template<
typename _Kt>
1290 find(
const _Kt& __x)
const ->
decltype(_M_t._M_find_tr(__x))
1291 {
return _M_t._M_find_tr(__x); }
1306 {
return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
1308#if __cplusplus > 201103L
1309 template<
typename _Kt>
1311 count(
const _Kt& __x)
const ->
decltype(_M_t._M_count_tr(__x))
1312 {
return _M_t._M_count_tr(__x); }
1316#if __cplusplus > 201703L
1325 {
return _M_t.find(__x) != _M_t.end(); }
1327 template<
typename _Kt>
1330 ->
decltype(_M_t._M_find_tr(__x),
void(),
true)
1331 {
return _M_t._M_find_tr(__x) != _M_t.end(); }
1349 {
return _M_t.lower_bound(__x); }
1351#if __cplusplus > 201103L
1352 template<
typename _Kt>
1355 ->
decltype(iterator(_M_t._M_lower_bound_tr(__x)))
1356 {
return iterator(_M_t._M_lower_bound_tr(__x)); }
1374 {
return _M_t.lower_bound(__x); }
1376#if __cplusplus > 201103L
1377 template<
typename _Kt>
1380 ->
decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
1381 {
return const_iterator(_M_t._M_lower_bound_tr(__x)); }
1394 {
return _M_t.upper_bound(__x); }
1396#if __cplusplus > 201103L
1397 template<
typename _Kt>
1400 ->
decltype(iterator(_M_t._M_upper_bound_tr(__x)))
1401 {
return iterator(_M_t._M_upper_bound_tr(__x)); }
1414 {
return _M_t.upper_bound(__x); }
1416#if __cplusplus > 201103L
1417 template<
typename _Kt>
1420 ->
decltype(const_iterator(_M_t._M_upper_bound_tr(__x)))
1421 {
return const_iterator(_M_t._M_upper_bound_tr(__x)); }
1443 {
return _M_t.equal_range(__x); }
1445#if __cplusplus > 201103L
1446 template<
typename _Kt>
1472 {
return _M_t.equal_range(__x); }
1474#if __cplusplus > 201103L
1475 template<
typename _Kt>
1479 _M_t._M_equal_range_tr(__x)))
1482 _M_t._M_equal_range_tr(__x));
1487 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1492#if __cpp_lib_three_way_comparison
1493 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1494 friend __detail::__synth3way_t<pair<const _K1, _T1>>
1498 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
1506#if __cpp_deduction_guides >= 201606
1508 template<
typename _InputIterator,
1509 typename _Compare = less<__iter_key_t<_InputIterator>>,
1510 typename _Allocator = allocator<__iter_to_alloc_t<_InputIterator>>,
1511 typename = _RequireInputIter<_InputIterator>,
1512 typename = _RequireNotAllocator<_Compare>,
1513 typename = _RequireAllocator<_Allocator>>
1514 map(_InputIterator, _InputIterator,
1515 _Compare = _Compare(), _Allocator = _Allocator())
1516 -> map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>,
1517 _Compare, _Allocator>;
1519 template<
typename _Key,
typename _Tp,
typename _Compare = less<_Key>,
1520 typename _Allocator = allocator<pair<const _Key, _Tp>>,
1521 typename = _RequireNotAllocator<_Compare>,
1522 typename = _RequireAllocator<_Allocator>>
1524 _Compare = _Compare(), _Allocator = _Allocator())
1525 -> map<_Key, _Tp, _Compare, _Allocator>;
1527 template <
typename _InputIterator,
typename _Allocator,
1528 typename = _RequireInputIter<_InputIterator>,
1529 typename = _RequireAllocator<_Allocator>>
1530 map(_InputIterator, _InputIterator, _Allocator)
1531 -> map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>,
1532 less<__iter_key_t<_InputIterator>>, _Allocator>;
1534 template<
typename _Key,
typename _Tp,
typename _Allocator,
1535 typename = _RequireAllocator<_Allocator>>
1537 -> map<_Key, _Tp, less<_Key>, _Allocator>;
1539#if __glibcxx_containers_ranges
1540 template<ranges::input_range _Rg,
1541 __not_allocator_like _Compare = less<__detail::__range_key_type<_Rg>>,
1542 __allocator_like _Alloc =
1544 map(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc())
1545 -> map<__detail::__range_key_type<_Rg>,
1546 __detail::__range_mapped_type<_Rg>,
1549 template<ranges::input_range _Rg, __allocator_like _Alloc>
1550 map(from_range_t, _Rg&&, _Alloc)
1551 -> map<__detail::__range_key_type<_Rg>,
1552 __detail::__range_mapped_type<_Rg>,
1553 less<__detail::__range_key_type<_Rg>>,
1569 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1573 {
return __x._M_t == __y._M_t; }
1575#if __cpp_lib_three_way_comparison
1590 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1591 inline __detail::__synth3way_t<pair<const _Key, _Tp>>
1592 operator<=>(
const map<_Key, _Tp, _Compare, _Alloc>& __x,
1593 const map<_Key, _Tp, _Compare, _Alloc>& __y)
1594 {
return __x._M_t <=> __y._M_t; }
1607 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1611 {
return __x._M_t < __y._M_t; }
1614 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1618 {
return !(__x == __y); }
1621 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1625 {
return __y < __x; }
1628 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1632 {
return !(__y < __x); }
1635 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1639 {
return !(__x < __y); }
1643 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
1647 _GLIBCXX_NOEXCEPT_IF(
noexcept(__x.
swap(__y)))
1650_GLIBCXX_END_NAMESPACE_CONTAINER
1652#if __cplusplus > 201402L
1654 template<
typename _Key,
typename _Val,
typename _Cmp1,
typename _Alloc,
1657 _Rb_tree_merge_helper<_GLIBCXX_STD_C::map<_Key, _Val, _Cmp1, _Alloc>,
1661 friend class _GLIBCXX_STD_C::map<_Key, _Val, _Cmp1, _Alloc>;
1664 _S_get_tree(_GLIBCXX_STD_C::map<_Key, _Val, _Cmp2, _Alloc>& __map)
1665 {
return __map._M_t; }
1668 _S_get_tree(_GLIBCXX_STD_C::multimap<_Key, _Val, _Cmp2, _Alloc>& __map)
1669 {
return __map._M_t; }
1673_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].
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.
auto count(const _Kt &__x) const -> decltype(_M_t._M_count_tr(__x))
Finds the number of elements with given key.
auto equal_range(const _Kt &__x) const -> decltype(pair< const_iterator, const_iterator >(_M_t._M_equal_range_tr(__x)))
Finds a subsequence matching given key.
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
auto lower_bound(const _Kt &__x) const -> decltype(const_iterator(_M_t._M_lower_bound_tr(__x)))
Finds the beginning of a subsequence matching given key.
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.
auto find(const _Kt &__x) -> decltype(_M_t._M_find_tr(__x))
Tries to locate an element in a map.
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.
auto upper_bound(const _Kt &__x) -> decltype(iterator(_M_t._M_upper_bound_tr(__x)))
Finds the end of a subsequence matching given key.
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.
auto lower_bound(const _Kt &__x) -> decltype(iterator(_M_t._M_lower_bound_tr(__x)))
Finds the beginning of a subsequence matching given key.
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.
auto upper_bound(const _Kt &__x) const -> decltype(const_iterator(_M_t._M_upper_bound_tr(__x)))
Finds the end of 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.
auto find(const _Kt &__x) const -> decltype(_M_t._M_find_tr(__x))
Tries to locate an element in 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.
auto equal_range(const _Kt &__x) -> decltype(pair< iterator, iterator >(_M_t._M_equal_range_tr(__x)))
Finds a subsequence matching given key.
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.