64 namespace std _GLIBCXX_VISIBILITY(default)
66 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
86 template <
typename _Key,
typename _Tp,
typename _Compare = std::less<_Key>,
87 typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
91 typedef _Key key_type;
92 typedef _Tp mapped_type;
94 typedef _Compare key_compare;
95 typedef _Alloc allocator_type;
99 typedef typename _Alloc::value_type _Alloc_value_type;
100 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
101 __glibcxx_class_requires4(_Compare,
bool, _Key, _Key,
102 _BinaryFunctionConcept)
103 __glibcxx_class_requires2(
value_type, _Alloc_value_type, _SameTypeConcept)
109 friend class map<_Key, _Tp, _Compare, _Alloc>;
113 value_compare(_Compare __c)
123 typedef typename _Alloc::template rebind<value_type>::other
126 typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
127 key_compare, _Pair_alloc_type> _Rep_type;
135 typedef typename _Pair_alloc_type::pointer pointer;
136 typedef typename _Pair_alloc_type::const_pointer const_pointer;
137 typedef typename _Pair_alloc_type::reference reference;
138 typedef typename _Pair_alloc_type::const_reference const_reference;
139 typedef typename _Rep_type::iterator iterator;
140 typedef typename _Rep_type::const_iterator const_iterator;
141 typedef typename _Rep_type::size_type size_type;
142 typedef typename _Rep_type::difference_type difference_type;
161 map(
const _Compare& __comp,
162 const allocator_type& __a = allocator_type())
163 : _M_t(__comp, __a) { }
175 #ifdef __GXX_EXPERIMENTAL_CXX0X__
184 : _M_t(std::move(__x._M_t)) { }
198 const _Compare& __c = _Compare(),
199 const allocator_type& __a = allocator_type())
201 { _M_t._M_insert_unique(__l.begin(), __l.end()); }
213 template<
typename _InputIterator>
214 map(_InputIterator __first, _InputIterator __last)
216 { _M_t._M_insert_unique(__first, __last); }
229 template<
typename _InputIterator>
230 map(_InputIterator __first, _InputIterator __last,
231 const _Compare& __comp,
232 const allocator_type& __a = allocator_type())
234 { _M_t._M_insert_unique(__first, __last); }
259 #ifdef __GXX_EXPERIMENTAL_CXX0X__
292 this->
insert(__l.begin(), __l.end());
300 {
return _M_t.get_allocator(); }
310 {
return _M_t.begin(); }
319 {
return _M_t.begin(); }
328 {
return _M_t.end(); }
337 {
return _M_t.end(); }
346 {
return _M_t.rbegin(); }
353 const_reverse_iterator
355 {
return _M_t.rbegin(); }
364 {
return _M_t.rend(); }
371 const_reverse_iterator
373 {
return _M_t.rend(); }
375 #ifdef __GXX_EXPERIMENTAL_CXX0X__
383 {
return _M_t.begin(); }
392 {
return _M_t.end(); }
399 const_reverse_iterator
401 {
return _M_t.rbegin(); }
408 const_reverse_iterator
410 {
return _M_t.rend(); }
419 {
return _M_t.empty(); }
424 {
return _M_t.size(); }
429 {
return _M_t.max_size(); }
448 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
454 return (*__i).second;
457 #ifdef __GXX_EXPERIMENTAL_CXX0X__
462 __glibcxx_function_requires(_DefaultConstructibleConcept<mapped_type>)
468 return (*__i).second;
482 at(
const key_type& __k)
486 __throw_out_of_range(__N(
"map::at"));
487 return (*__i).second;
491 at(
const key_type& __k)
const
495 __throw_out_of_range(__N(
"map::at"));
496 return (*__i).second;
518 {
return _M_t._M_insert_unique(__x); }
520 #ifdef __GXX_EXPERIMENTAL_CXX0X__
521 template<
typename _Pair,
typename =
typename
523 value_type>::value>::type>
526 {
return _M_t._M_insert_unique(std::forward<_Pair>(__x)); }
529 #ifdef __GXX_EXPERIMENTAL_CXX0X__
539 {
insert(__list.begin(), __list.end()); }
566 #ifdef __GXX_EXPERIMENTAL_CXX0X__
571 {
return _M_t._M_insert_unique_(__position, __x); }
573 #ifdef __GXX_EXPERIMENTAL_CXX0X__
574 template<
typename _Pair,
typename =
typename
576 value_type>::value>::type>
578 insert(const_iterator __position, _Pair&& __x)
579 {
return _M_t._M_insert_unique_(__position,
580 std::forward<_Pair>(__x)); }
591 template<
typename _InputIterator>
593 insert(_InputIterator __first, _InputIterator __last)
594 { _M_t._M_insert_unique(__first, __last); }
596 #ifdef __GXX_EXPERIMENTAL_CXX0X__
614 {
return _M_t.erase(__position); }
619 {
return _M_t.erase(__position); }
632 erase(iterator __position)
633 { _M_t.erase(__position); }
649 {
return _M_t.erase(__x); }
651 #ifdef __GXX_EXPERIMENTAL_CXX0X__
667 erase(const_iterator __first, const_iterator __last)
668 {
return _M_t.erase(__first, __last); }
683 { _M_t.erase(__first, __last); }
699 { _M_t.swap(__x._M_t); }
718 {
return _M_t.key_comp(); }
726 {
return value_compare(_M_t.key_comp()); }
742 {
return _M_t.find(__x); }
756 find(
const key_type& __x)
const
757 {
return _M_t.find(__x); }
769 {
return _M_t.find(__x) == _M_t.end() ? 0 : 1; }
784 {
return _M_t.lower_bound(__x); }
799 {
return _M_t.lower_bound(__x); }
809 {
return _M_t.upper_bound(__x); }
819 {
return _M_t.upper_bound(__x); }
838 {
return _M_t.equal_range(__x); }
857 {
return _M_t.equal_range(__x); }
859 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
864 template<
typename _K1,
typename _T1,
typename _C1,
typename _A1>
866 operator<(const map<_K1, _T1, _C1, _A1>&,
880 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
884 {
return __x._M_t == __y._M_t; }
897 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
899 operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
901 {
return __x._M_t < __y._M_t; }
904 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
908 {
return !(__x == __y); }
911 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
915 {
return __y < __x; }
918 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
920 operator<=(const map<_Key, _Tp, _Compare, _Alloc>& __x,
922 {
return !(__y < __x); }
925 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
929 {
return !(__x < __y); }
932 template<
typename _Key,
typename _Tp,
typename _Compare,
typename _Alloc>
938 _GLIBCXX_END_NAMESPACE_CONTAINER