19720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* 29720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * 39720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1994 49720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Hewlett-Packard Company 59720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * 69720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1996,1997 79720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Silicon Graphics Computer Systems, Inc. 89720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * 99720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1997 109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Moscow Center for SPARC Technology 119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * 129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 1999 139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Boris Fomitchev 149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * 159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * This material is provided "as is", with absolutely no warranty expressed 169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * or implied. Any use is at your own risk. 179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * 189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to use or copy this software for any purpose is hereby granted 199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * without fee, provided the above notices are retained on all copies. 209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to modify the code and to distribute modified code is granted, 219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * provided the above notices are retained, and a notice that the code was 229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * modified is included with the above copyright notice. 239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * 249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */ 259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* NOTE: This is an internal header file, included by other STL headers. 279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * You should not attempt to use it directly. 289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */ 299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_MAP_H 319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_INTERNAL_MAP_H 329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_INTERNAL_TREE_H 349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block# include <stl/_tree.h> 359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif 369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_BEGIN_NAMESPACE 389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block//Specific iterator traits creation 409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_CREATE_ITERATOR_TRAITS(MapTraitsT, traits) 419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_Compare, less<_Key> ), 43e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_STLP_CONST _Key, _Tp) > 449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass map 459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) 469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : public __stlport_class<map<_Key, _Tp, _Compare, _Alloc> > 479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif 489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ 499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef map<_Key, _Tp, _Compare, _Alloc> _Self; 509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic: 519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// typedefs: 539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Key key_type; 559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Tp data_type; 569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Tp mapped_type; 57e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott typedef pair<_STLP_CONST _Key, _Tp> value_type; 589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Compare key_compare; 599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block class value_compare 619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : public binary_function<value_type, value_type, bool> { 629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block friend class map<_Key,_Tp,_Compare,_Alloc>; 639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block protected : 649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block //c is a Standard name (23.3.1), do no make it STLport naming convention compliant. 659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _Compare comp; 669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block value_compare(_Compare __c) : comp(__c) {} 679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block public: 689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block bool operator()(const value_type& __x, const value_type& __y) const 699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return comp(__x.first, __y.first); } 709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block }; 719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprotected: 739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _STLP_PRIV _MapTraitsT<value_type> _MapTraits; 749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic: 769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block //Following typedef have to be public for __move_traits specialization. 779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _STLP_PRIV _Rb_tree<key_type, key_compare, 789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block value_type, _STLP_SELECT1ST(value_type, _Key), 799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _MapTraits, _Alloc> _Rep_type; 809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::pointer pointer; 829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_pointer const_pointer; 839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::reference reference; 849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_reference const_reference; 859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::iterator iterator; 869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_iterator const_iterator; 879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::reverse_iterator reverse_iterator; 889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; 899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::size_type size_type; 909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::difference_type difference_type; 919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::allocator_type allocator_type; 929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate: 949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _Rep_type _M_t; // red-black tree representing map 959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_KEY_TYPE_FOR_CONT_EXT(key_type) 969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic: 989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // allocation/deallocation 999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map() : _M_t(_Compare(), allocator_type()) {} 1009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined (_STLP_DONT_SUP_DFLT_PARAM) 1019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block explicit map(const _Compare& __comp, 1029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a = allocator_type()) 1039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else 1049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block explicit map(const _Compare& __comp) 1059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, allocator_type()) {} 1069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block explicit map(const _Compare& __comp, const allocator_type& __a) 1079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif 1089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) {} 1099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATES) 1119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 1129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(_InputIterator __first, _InputIterator __last) 1139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(_Compare(), allocator_type()) 1149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_unique(__first, __last); } 1159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 1179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(_InputIterator __first, _InputIterator __last, const _Compare& __comp, 1189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL) 1199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); } 1209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS) 1229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 1239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(_InputIterator __first, _InputIterator __last, const _Compare& __comp) 1249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, allocator_type()) { _M_t.insert_unique(__first, __last); } 1259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block# endif 1269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else 1289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(const value_type* __first, const value_type* __last) 1299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(_Compare(), allocator_type()) 1309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_unique(__first, __last); } 1319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(const value_type* __first, 1339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const value_type* __last, const _Compare& __comp, 1349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a = allocator_type()) 1359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); } 1369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(const_iterator __first, const_iterator __last) 1389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(_Compare(), allocator_type()) 1399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_unique(__first, __last); } 1409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(const_iterator __first, const_iterator __last, const _Compare& __comp, 1429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a = allocator_type()) 1439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); } 1449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_MEMBER_TEMPLATES */ 1459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(const _Self& __x) : _M_t(__x._M_t) {} 1479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 148e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_MOVE_SEMANTIC) 1499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block map(__move_source<_Self> src) 1509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__move_source<_Rep_type>(src.get()._M_t)) {} 151e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif 1529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _Self& operator=(const _Self& __x) { 1549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _M_t = __x._M_t; 1559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block return *this; 1569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block } 1579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // accessors: 1599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block key_compare key_comp() const { return _M_t.key_comp(); } 1609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block value_compare value_comp() const { return value_compare(_M_t.key_comp()); } 1619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block allocator_type get_allocator() const { return _M_t.get_allocator(); } 1629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator begin() { return _M_t.begin(); } 1649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator begin() const { return _M_t.begin(); } 1659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator end() { return _M_t.end(); } 1669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator end() const { return _M_t.end(); } 1679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block reverse_iterator rbegin() { return _M_t.rbegin(); } 1689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_reverse_iterator rbegin() const { return _M_t.rbegin(); } 1699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block reverse_iterator rend() { return _M_t.rend(); } 1709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_reverse_iterator rend() const { return _M_t.rend(); } 1719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block bool empty() const { return _M_t.empty(); } 1729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type size() const { return _M_t.size(); } 1739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type max_size() const { return _M_t.max_size(); } 1749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 1759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _Tp& operator[](const _KT& __k) { 1769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator __i = lower_bound(__k); 1779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // __i->first is greater than or equivalent to __k. 1789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block if (__i == end() || key_comp()(__k, (*__i).first)) 1799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block __i = insert(__i, value_type(__k, _STLP_DEFAULT_CONSTRUCTED(_Tp))); 1809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block return (*__i).second; 1819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block } 1829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void swap(_Self& __x) { _M_t.swap(__x._M_t); } 183e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) 184e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott void _M_swap_workaround(_Self& __x) { swap(__x); } 185e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif 1869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 1879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // insert/erase 1889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block pair<iterator,bool> insert(const value_type& __x) 1899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return _M_t.insert_unique(__x); } 1909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator insert(iterator __pos, const value_type& __x) 1919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return _M_t.insert_unique(__pos, __x); } 1929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifdef _STLP_MEMBER_TEMPLATES 1939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 1949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void insert(_InputIterator __first, _InputIterator __last) 1959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_unique(__first, __last); } 1969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else 1979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void insert(const value_type* __first, const value_type* __last) 1989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_unique(__first, __last); } 1999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void insert(const_iterator __first, const_iterator __last) 2009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_unique(__first, __last); } 2019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_MEMBER_TEMPLATES */ 2029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void erase(iterator __pos) { _M_t.erase(__pos); } 2049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type erase(const key_type& __x) { return _M_t.erase_unique(__x); } 2059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void erase(iterator __first, iterator __last) { _M_t.erase(__first, __last); } 2069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void clear() { _M_t.clear(); } 2079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // map operations: 2099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator find(const _KT& __x) { return _M_t.find(__x); } 2119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator find(const _KT& __x) const { return _M_t.find(__x); } 2139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type count(const _KT& __x) const { return _M_t.find(__x) == _M_t.end() ? 0 : 1; } 2159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator lower_bound(const _KT& __x) { return _M_t.lower_bound(__x); } 2179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator lower_bound(const _KT& __x) const { return _M_t.lower_bound(__x); } 2199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator upper_bound(const _KT& __x) { return _M_t.upper_bound(__x); } 2219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator upper_bound(const _KT& __x) const { return _M_t.upper_bound(__x); } 2239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block pair<iterator,iterator> equal_range(const _KT& __x) 2269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return _M_t.equal_range_unique(__x); } 2279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 2289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block pair<const_iterator,const_iterator> equal_range(const _KT& __x) const 2299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return _M_t.equal_range_unique(__x); } 2309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block}; 2319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block//Specific iterator traits creation 2339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_CREATE_ITERATOR_TRAITS(MultimapTraitsT, traits) 2349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, _STLP_DFL_TMPL_PARAM(_Compare, less<_Key> ), 236e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_STLP_CONST _Key, _Tp) > 2379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass multimap 2389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) 2399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : public __stlport_class<multimap<_Key, _Tp, _Compare, _Alloc> > 2409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif 2419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{ 2429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef multimap<_Key, _Tp, _Compare, _Alloc> _Self; 2439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic: 2449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// typedefs: 2469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Key key_type; 2489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Tp data_type; 2499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Tp mapped_type; 250e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott typedef pair<_STLP_CONST _Key, _Tp> value_type; 2519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _Compare key_compare; 2529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block class value_compare : public binary_function<value_type, value_type, bool> { 2549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block friend class multimap<_Key,_Tp,_Compare,_Alloc>; 2559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block protected: 2569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block //comp is a Standard name (23.3.2), do no make it STLport naming convention compliant. 2579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _Compare comp; 2589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block value_compare(_Compare __c) : comp(__c) {} 2599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block public: 2609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block bool operator()(const value_type& __x, const value_type& __y) const 2619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return comp(__x.first, __y.first); } 2629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block }; 2639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprotected: 2659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block //Specific iterator traits creation 2669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _STLP_PRIV _MultimapTraitsT<value_type> _MultimapTraits; 2679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic: 2699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block //Following typedef have to be public for __move_traits specialization. 2709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef _STLP_PRIV _Rb_tree<key_type, key_compare, 2719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block value_type, _STLP_SELECT1ST(value_type, _Key), 2729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _MultimapTraits, _Alloc> _Rep_type; 2739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::pointer pointer; 2759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_pointer const_pointer; 2769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::reference reference; 2779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_reference const_reference; 2789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::iterator iterator; 2799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_iterator const_iterator; 2809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::reverse_iterator reverse_iterator; 2819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; 2829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::size_type size_type; 2839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::difference_type difference_type; 2849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block typedef typename _Rep_type::allocator_type allocator_type; 2859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate: 2879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _Rep_type _M_t; // red-black tree representing multimap 2889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_KEY_TYPE_FOR_CONT_EXT(key_type) 2899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic: 2919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // allocation/deallocation 2929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap() : _M_t(_Compare(), allocator_type()) { } 2939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block explicit multimap(const _Compare& __comp, 2949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a = allocator_type()) 2959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) { } 2969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 2979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifdef _STLP_MEMBER_TEMPLATES 2989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 2999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(_InputIterator __first, _InputIterator __last) 3009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(_Compare(), allocator_type()) 3019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_equal(__first, __last); } 3029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block# ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS 3039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 3049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(_InputIterator __first, _InputIterator __last, 3059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const _Compare& __comp) 3069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, allocator_type()) { _M_t.insert_equal(__first, __last); } 3079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block# endif 3089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 3099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(_InputIterator __first, _InputIterator __last, 3109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const _Compare& __comp, 3119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL) 3129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); } 3139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else 3149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(const value_type* __first, const value_type* __last) 3159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(_Compare(), allocator_type()) 3169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_equal(__first, __last); } 3179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(const value_type* __first, const value_type* __last, 3189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const _Compare& __comp, 3199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a = allocator_type()) 3209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); } 3219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(const_iterator __first, const_iterator __last) 3239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(_Compare(), allocator_type()) 3249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_equal(__first, __last); } 3259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(const_iterator __first, const_iterator __last, 3269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const _Compare& __comp, 3279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const allocator_type& __a = allocator_type()) 3289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); } 3299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_MEMBER_TEMPLATES */ 3309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(const _Self& __x) : _M_t(__x._M_t) {} 3329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 333e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_MOVE_SEMANTIC) 3349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block multimap(__move_source<_Self> src) 3359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block : _M_t(__move_source<_Rep_type>(src.get()._M_t)) {} 336e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif 3379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _Self& operator=(const _Self& __x) { 3399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _M_t = __x._M_t; 3409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block return *this; 3419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block } 3429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // accessors: 3449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block key_compare key_comp() const { return _M_t.key_comp(); } 3469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block value_compare value_comp() const { return value_compare(_M_t.key_comp()); } 3479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block allocator_type get_allocator() const { return _M_t.get_allocator(); } 3489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator begin() { return _M_t.begin(); } 3509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator begin() const { return _M_t.begin(); } 3519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator end() { return _M_t.end(); } 3529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator end() const { return _M_t.end(); } 3539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block reverse_iterator rbegin() { return _M_t.rbegin(); } 3549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_reverse_iterator rbegin() const { return _M_t.rbegin(); } 3559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block reverse_iterator rend() { return _M_t.rend(); } 3569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_reverse_iterator rend() const { return _M_t.rend(); } 3579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block bool empty() const { return _M_t.empty(); } 3589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type size() const { return _M_t.size(); } 3599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type max_size() const { return _M_t.max_size(); } 3609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void swap(_Self& __x) { _M_t.swap(__x._M_t); } 361e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) 362e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott void _M_swap_workaround(_Self& __x) { swap(__x); } 363e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif 3649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // insert/erase 3669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator insert(const value_type& __x) { return _M_t.insert_equal(__x); } 3679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator insert(iterator __pos, const value_type& __x) { return _M_t.insert_equal(__pos, __x); } 3689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATES) 3699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block template <class _InputIterator> 3709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void insert(_InputIterator __first, _InputIterator __last) 3719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_equal(__first, __last); } 3729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else 3739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void insert(const value_type* __first, const value_type* __last) 3749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_equal(__first, __last); } 3759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void insert(const_iterator __first, const_iterator __last) 3769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { _M_t.insert_equal(__first, __last); } 3779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_MEMBER_TEMPLATES */ 3789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void erase(iterator __pos) { _M_t.erase(__pos); } 3799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type erase(const key_type& __x) { return _M_t.erase(__x); } 3809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void erase(iterator __first, iterator __last) { _M_t.erase(__first, __last); } 3819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block void clear() { _M_t.clear(); } 3829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block // multimap operations: 3849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 3859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 3869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator find(const _KT& __x) { return _M_t.find(__x); } 3879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 3889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator find(const _KT& __x) const { return _M_t.find(__x); } 3899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 3909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block size_type count(const _KT& __x) const { return _M_t.count(__x); } 3919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 3929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator lower_bound(const _KT& __x) { return _M_t.lower_bound(__x); } 3939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 3949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator lower_bound(const _KT& __x) const { return _M_t.lower_bound(__x); } 3959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 3969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block iterator upper_bound(const _KT& __x) { return _M_t.upper_bound(__x); } 3979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 3989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block const_iterator upper_bound(const _KT& __x) const { return _M_t.upper_bound(__x); } 3999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 4009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block pair<iterator,iterator> equal_range(const _KT& __x) 4019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return _M_t.equal_range(__x); } 4029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_TEMPLATE_FOR_CONT_EXT 4039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block pair<const_iterator,const_iterator> equal_range(const _KT& __x) const 4049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block { return _M_t.equal_range(__x); } 4059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block}; 4069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 4079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_TEMPLATE_HEADER template <class _Key, class _Tp, class _Compare, class _Alloc> 4089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_TEMPLATE_CONTAINER map<_Key,_Tp,_Compare,_Alloc> 4099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#include <stl/_relops_cont.h> 4109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#undef _STLP_TEMPLATE_CONTAINER 4119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_TEMPLATE_CONTAINER multimap<_Key,_Tp,_Compare,_Alloc> 4129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#include <stl/_relops_cont.h> 4139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#undef _STLP_TEMPLATE_CONTAINER 4149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#undef _STLP_TEMPLATE_HEADER 4159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 416e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_NO_MOVE_SEMANTIC) 4179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, class _Compare, class _Alloc> 4189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __move_traits<map<_Key,_Tp,_Compare,_Alloc> > : 4199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_PRIV __move_traits_aux<typename map<_Key,_Tp,_Compare,_Alloc>::_Rep_type> 4209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{}; 4219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 4229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blocktemplate <class _Key, class _Tp, class _Compare, class _Alloc> 4239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockstruct __move_traits<multimap<_Key,_Tp,_Compare,_Alloc> > : 4249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block _STLP_PRIV __move_traits_aux<typename multimap<_Key,_Tp,_Compare,_Alloc>::_Rep_type> 4259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{}; 4269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif 4279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 4289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_END_NAMESPACE 4299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 4309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_INTERNAL_MAP_H */ 4319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 4329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// Local Variables: 4339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// mode:C++ 4349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block// End: 4359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block 436