Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygen_deque.h
Go to the documentation of this file.
00001 /* 00002 * 00003 * Copyright (c) 1994 00004 * Hewlett-Packard Company 00005 * 00006 * Copyright (c) 1996,1997 00007 * Silicon Graphics Computer Systems, Inc. 00008 * 00009 * Copyright (c) 1997 00010 * Moscow Center for SPARC Technology 00011 * 00012 * Copyright (c) 1999 00013 * Boris Fomitchev 00014 * 00015 * This material is provided "as is", with absolutely no warranty expressed 00016 * or implied. Any use is at your own risk. 00017 * 00018 * Permission to use or copy this software for any purpose is hereby granted 00019 * without fee, provided the above notices are retained on all copies. 00020 * Permission to modify the code and to distribute modified code is granted, 00021 * provided the above notices are retained, and a notice that the code was 00022 * modified is included with the above copyright notice. 00023 * 00024 */ 00025 00026 /* NOTE: This is an internal header file, included by other STL headers. 00027 * You should not attempt to use it directly. 00028 */ 00029 00030 #ifndef _STLP_INTERNAL_DEQUE_H 00031 #define _STLP_INTERNAL_DEQUE_H 00032 00033 #ifndef _STLP_INTERNAL_ALGOBASE_H 00034 # include <stl/_algobase.h> 00035 #endif 00036 00037 #ifndef _STLP_INTERNAL_ALLOC_H 00038 # include <stl/_alloc.h> 00039 #endif 00040 00041 #ifndef _STLP_INTERNAL_ITERATOR_H 00042 # include <stl/_iterator.h> 00043 #endif 00044 00045 #ifndef _STLP_INTERNAL_UNINITIALIZED_H 00046 # include <stl/_uninitialized.h> 00047 #endif 00048 00049 #ifndef _STLP_RANGE_ERRORS_H 00050 # include <stl/_range_errors.h> 00051 #endif 00052 00053 /* Class invariants: 00054 * For any nonsingular iterator i: 00055 * i.node is the address of an element in the map array. The 00056 * contents of i.node is a pointer to the beginning of a node. 00057 * i.first == *(i.node) 00058 * i.last == i.first + node_size 00059 * i.cur is a pointer in the range [i.first, i.last). NOTE: 00060 * the implication of this is that i.cur is always a dereferenceable 00061 * pointer, even if i is a past-the-end iterator. 00062 * Start and Finish are always nonsingular iterators. NOTE: this means 00063 * that an empty deque must have one node, and that a deque 00064 * with N elements, where N is the buffer size, must have two nodes. 00065 * For every node other than start.node and finish.node, every element 00066 * in the node is an initialized object. If start.node == finish.node, 00067 * then [start.cur, finish.cur) are initialized objects, and 00068 * the elements outside that range are uninitialized storage. Otherwise, 00069 * [start.cur, start.last) and [finish.first, finish.cur) are initialized 00070 * objects, and [start.first, start.cur) and [finish.cur, finish.last) 00071 * are uninitialized storage. 00072 * [map, map + map_size) is a valid, non-empty range. 00073 * [start.node, finish.node] is a valid range contained within 00074 * [map, map + map_size). 00075 * A pointer in the range [map, map + map_size) points to an allocated node 00076 * if and only if the pointer is in the range [start.node, finish.node]. 00077 */ 00078 00079 _STLP_BEGIN_NAMESPACE 00080 00081 _STLP_MOVE_TO_PRIV_NAMESPACE 00082 00083 template <class _Tp> 00084 struct _Deque_iterator_base { 00085 00086 static size_t _S_buffer_size() { 00087 const size_t blocksize = _MAX_BYTES; 00088 return (sizeof(_Tp) < blocksize ? (blocksize / sizeof(_Tp)) : 1); 00089 } 00090 00091 typedef random_access_iterator_tag iterator_category; 00092 00093 typedef _Tp value_type; 00094 typedef size_t size_type; 00095 typedef ptrdiff_t difference_type; 00096 00097 typedef value_type** _Map_pointer; 00098 00099 typedef _Deque_iterator_base< _Tp > _Self; 00100 00101 value_type* _M_cur; 00102 value_type* _M_first; 00103 value_type* _M_last; 00104 _Map_pointer _M_node; 00105 00106 _Deque_iterator_base(value_type* __x, _Map_pointer __y) 00107 : _M_cur(__x), _M_first(*__y), 00108 _M_last(*__y + _S_buffer_size()), _M_node(__y) {} 00109 00110 _Deque_iterator_base() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {} 00111 00112 // see comment in doc/README.evc4 and doc/README.evc8 00113 #if defined (_STLP_MSVC) && (_STLP_MSVC <= 1401) && defined (MIPS) && defined (NDEBUG) 00114 _Deque_iterator_base(_Deque_iterator_base const& __other) 00115 : _M_cur(__other._M_cur), _M_first(__other._M_first), 00116 _M_last(__other._M_last), _M_node(__other._M_node) {} 00117 #endif 00118 00119 difference_type _M_subtract(const _Self& __x) const { 00120 return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) + 00121 (_M_cur - _M_first) + (__x._M_last - __x._M_cur); 00122 } 00123 00124 void _M_increment() { 00125 if (++_M_cur == _M_last) { 00126 _M_set_node(_M_node + 1); 00127 _M_cur = _M_first; 00128 } 00129 } 00130 00131 void _M_decrement() { 00132 if (_M_cur == _M_first) { 00133 _M_set_node(_M_node - 1); 00134 _M_cur = _M_last; 00135 } 00136 --_M_cur; 00137 } 00138 00139 void _M_advance(difference_type __n) { 00140 const size_t buffersize = _S_buffer_size(); 00141 difference_type __offset = __n + (_M_cur - _M_first); 00142 if (__offset >= 0 && __offset < difference_type(buffersize)) 00143 _M_cur += __n; 00144 else { 00145 difference_type __node_offset = 00146 __offset > 0 ? __offset / buffersize 00147 : -difference_type((-__offset - 1) / buffersize) - 1; 00148 _M_set_node(_M_node + __node_offset); 00149 _M_cur = _M_first + 00150 00151 (__offset - __node_offset * difference_type(buffersize)); 00152 } 00153 } 00154 00155 void _M_set_node(_Map_pointer __new_node) { 00156 _M_last = (_M_first = *(_M_node = __new_node)) + difference_type(_S_buffer_size()); 00157 } 00158 }; 00159 00160 00161 template <class _Tp, class _Traits> 00162 struct _Deque_iterator : public _Deque_iterator_base< _Tp> { 00163 typedef random_access_iterator_tag iterator_category; 00164 typedef _Tp value_type; 00165 typedef typename _Traits::reference reference; 00166 typedef typename _Traits::pointer pointer; 00167 typedef size_t size_type; 00168 typedef ptrdiff_t difference_type; 00169 typedef value_type** _Map_pointer; 00170 00171 typedef _Deque_iterator_base< _Tp > _Base; 00172 typedef _Deque_iterator<_Tp, _Traits> _Self; 00173 typedef typename _Traits::_NonConstTraits _NonConstTraits; 00174 typedef _Deque_iterator<_Tp, _NonConstTraits> iterator; 00175 typedef typename _Traits::_ConstTraits _ConstTraits; 00176 typedef _Deque_iterator<_Tp, _ConstTraits> const_iterator; 00177 00178 _Deque_iterator(value_type* __x, _Map_pointer __y) : 00179 _Deque_iterator_base<value_type>(__x,__y) {} 00180 00181 _Deque_iterator() {} 00182 //copy constructor for iterator and constructor from iterator for const_iterator 00183 _Deque_iterator(const iterator& __x) : 00184 _Deque_iterator_base<value_type>(__x) {} 00185 00186 reference operator*() const { 00187 return *this->_M_cur; 00188 } 00189 00190 _STLP_DEFINE_ARROW_OPERATOR 00191 00192 difference_type operator-(const const_iterator& __x) const { return this->_M_subtract(__x); } 00193 00194 _Self& operator++() { this->_M_increment(); return *this; } 00195 _Self operator++(int) { 00196 _Self __tmp = *this; 00197 ++*this; 00198 return __tmp; 00199 } 00200 00201 _Self& operator--() { this->_M_decrement(); return *this; } 00202 _Self operator--(int) { 00203 _Self __tmp = *this; 00204 --*this; 00205 return __tmp; 00206 } 00207 00208 _Self& operator+=(difference_type __n) { this->_M_advance(__n); return *this; } 00209 _Self operator+(difference_type __n) const { 00210 _Self __tmp = *this; 00211 return __tmp += __n; 00212 } 00213 00214 _Self& operator-=(difference_type __n) { return *this += -__n; } 00215 _Self operator-(difference_type __n) const { 00216 _Self __tmp = *this; 00217 return __tmp -= __n; 00218 } 00219 00220 reference operator[](difference_type __n) const { return *(*this + __n); } 00221 }; 00222 00223 00224 template <class _Tp, class _Traits> 00225 inline _Deque_iterator<_Tp, _Traits> _STLP_CALL 00226 operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Traits>& __x) 00227 { return __x + __n; } 00228 00229 00230 #if defined (_STLP_USE_SEPARATE_RELOPS_NAMESPACE) 00231 template <class _Tp> 00232 inline bool _STLP_CALL 00233 operator==(const _Deque_iterator_base<_Tp >& __x, 00234 const _Deque_iterator_base<_Tp >& __y) 00235 { return __x._M_cur == __y._M_cur; } 00236 00237 template <class _Tp> 00238 inline bool _STLP_CALL 00239 operator < (const _Deque_iterator_base<_Tp >& __x, 00240 const _Deque_iterator_base<_Tp >& __y) { 00241 return (__x._M_node == __y._M_node) ? 00242 (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node); 00243 } 00244 00245 template <class _Tp> 00246 inline bool _STLP_CALL 00247 operator!=(const _Deque_iterator_base<_Tp >& __x, 00248 const _Deque_iterator_base<_Tp >& __y) 00249 { return __x._M_cur != __y._M_cur; } 00250 00251 template <class _Tp> 00252 inline bool _STLP_CALL 00253 operator>(const _Deque_iterator_base<_Tp >& __x, 00254 const _Deque_iterator_base<_Tp >& __y) 00255 { return __y < __x; } 00256 00257 template <class _Tp> 00258 inline bool _STLP_CALL operator>=(const _Deque_iterator_base<_Tp >& __x, 00259 const _Deque_iterator_base<_Tp >& __y) 00260 { return !(__x < __y); } 00261 00262 template <class _Tp> 00263 inline bool _STLP_CALL operator<=(const _Deque_iterator_base<_Tp >& __x, 00264 const _Deque_iterator_base<_Tp >& __y) 00265 { return !(__y < __x); } 00266 00267 #else /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */ 00268 00269 template <class _Tp, class _Traits1, class _Traits2> 00270 inline bool _STLP_CALL 00271 operator==(const _Deque_iterator<_Tp, _Traits1 >& __x, 00272 const _Deque_iterator<_Tp, _Traits2 >& __y) 00273 { return __x._M_cur == __y._M_cur; } 00274 00275 template <class _Tp, class _Traits1, class _Traits2> 00276 inline bool _STLP_CALL 00277 operator < (const _Deque_iterator<_Tp, _Traits1 >& __x, 00278 const _Deque_iterator<_Tp, _Traits2 >& __y) { 00279 return (__x._M_node == __y._M_node) ? 00280 (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node); 00281 } 00282 00283 template <class _Tp> 00284 inline bool _STLP_CALL 00285 operator!=(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x, 00286 const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y) 00287 { return __x._M_cur != __y._M_cur; } 00288 00289 template <class _Tp> 00290 inline bool _STLP_CALL 00291 operator>(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x, 00292 const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y) 00293 { return __y < __x; } 00294 00295 template <class _Tp> 00296 inline bool _STLP_CALL 00297 operator>=(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x, 00298 const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y) 00299 { return !(__x < __y); } 00300 00301 template <class _Tp> 00302 inline bool _STLP_CALL 00303 operator<=(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x, 00304 const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y) 00305 { return !(__y < __x); } 00306 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */ 00307 00308 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) 00309 _STLP_MOVE_TO_STD_NAMESPACE 00310 template <class _Tp, class _Traits> 00311 struct __type_traits<_STLP_PRIV _Deque_iterator<_Tp, _Traits> > { 00312 typedef __false_type has_trivial_default_constructor; 00313 typedef __true_type has_trivial_copy_constructor; 00314 typedef __true_type has_trivial_assignment_operator; 00315 typedef __true_type has_trivial_destructor; 00316 typedef __false_type is_POD_type; 00317 }; 00318 _STLP_MOVE_TO_PRIV_NAMESPACE 00319 #endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ 00320 00321 #if defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES) 00322 _STLP_MOVE_TO_STD_NAMESPACE 00323 template <class _Tp, class _Traits> inline _Tp* _STLP_CALL 00324 value_type(const _STLP_PRIV _Deque_iterator<_Tp, _Traits >&) { return (_Tp*)0; } 00325 template <class _Tp, class _Traits> inline random_access_iterator_tag _STLP_CALL 00326 iterator_category(const _STLP_PRIV _Deque_iterator<_Tp, _Traits >&) { return random_access_iterator_tag(); } 00327 template <class _Tp, class _Traits> inline ptrdiff_t* _STLP_CALL 00328 distance_type(const _STLP_PRIV _Deque_iterator<_Tp, _Traits >&) { return 0; } 00329 _STLP_MOVE_TO_PRIV_NAMESPACE 00330 #endif 00331 00332 /* Deque base class. It has two purposes. First, its constructor 00333 * and destructor allocate (but don't initialize) storage. This makes 00334 * exception safety easier. Second, the base class encapsulates all of 00335 * the differences between SGI-style allocators and standard-conforming 00336 * allocators. 00337 */ 00338 00339 template <class _Tp, class _Alloc> 00340 class _Deque_base { 00341 typedef _Deque_base<_Tp, _Alloc> _Self; 00342 public: 00343 typedef _Tp value_type; 00344 _STLP_FORCE_ALLOCATORS(_Tp, _Alloc) 00345 typedef _Alloc allocator_type; 00346 typedef _STLP_alloc_proxy<size_t, value_type, allocator_type> _Alloc_proxy; 00347 00348 typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type _Map_alloc_type; 00349 typedef _STLP_alloc_proxy<value_type**, value_type*, _Map_alloc_type> _Map_alloc_proxy; 00350 00351 typedef _Deque_iterator<_Tp, _Nonconst_traits<_Tp> > iterator; 00352 typedef _Deque_iterator<_Tp, _Const_traits<_Tp> > const_iterator; 00353 00354 static size_t _STLP_CALL buffer_size() { return _Deque_iterator_base<_Tp>::_S_buffer_size(); } 00355 00356 _Deque_base(const allocator_type& __a, size_t __num_elements) 00357 : _M_start(), _M_finish(), _M_map(_STLP_CONVERT_ALLOCATOR(__a, _Tp*), 0), 00358 _M_map_size(__a, (size_t)0) 00359 { _M_initialize_map(__num_elements); } 00360 00361 _Deque_base(const allocator_type& __a) 00362 : _M_start(), _M_finish(), _M_map(_STLP_CONVERT_ALLOCATOR(__a, _Tp*), 0), 00363 _M_map_size(__a, (size_t)0) {} 00364 00365 #if !defined (_STLP_NO_MOVE_SEMANTIC) 00366 _Deque_base(__move_source<_Self> src) 00367 : _M_start(src.get()._M_start), _M_finish(src.get()._M_finish), 00368 _M_map(__move_source<_Map_alloc_proxy>(src.get()._M_map)), 00369 _M_map_size(__move_source<_Alloc_proxy>(src.get()._M_map_size)) { 00370 src.get()._M_map._M_data = 0; 00371 src.get()._M_map_size._M_data = 0; 00372 src.get()._M_finish = src.get()._M_start; 00373 } 00374 #endif 00375 00376 ~_Deque_base(); 00377 00378 protected: 00379 void _M_initialize_map(size_t); 00380 void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish); 00381 void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish); 00382 enum { _S_initial_map_size = 8 }; 00383 00384 protected: 00385 iterator _M_start; 00386 iterator _M_finish; 00387 _Map_alloc_proxy _M_map; 00388 _Alloc_proxy _M_map_size; 00389 }; 00390 00391 #if defined (_STLP_USE_PTR_SPECIALIZATIONS) 00392 # define deque _STLP_PTR_IMPL_NAME(deque) 00393 #elif defined (_STLP_DEBUG) 00394 # define deque _STLP_NON_DBG_NAME(deque) 00395 #else 00396 _STLP_MOVE_TO_STD_NAMESPACE 00397 #endif 00398 00399 template <class _Tp, _STLP_DFL_TMPL_PARAM(_Alloc, allocator<_Tp>) > 00400 class deque : protected _STLP_PRIV _Deque_base<_Tp, _Alloc> 00401 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (deque) 00402 , public __stlport_class<deque<_Tp, _Alloc> > 00403 #endif 00404 { 00405 typedef _STLP_PRIV _Deque_base<_Tp, _Alloc> _Base; 00406 typedef deque<_Tp, _Alloc> _Self; 00407 public: // Basic types 00408 typedef _Tp value_type; 00409 typedef value_type* pointer; 00410 typedef const value_type* const_pointer; 00411 typedef value_type& reference; 00412 typedef const value_type& const_reference; 00413 typedef size_t size_type; 00414 typedef ptrdiff_t difference_type; 00415 typedef random_access_iterator_tag _Iterator_category; 00416 _STLP_FORCE_ALLOCATORS(_Tp, _Alloc) 00417 typedef typename _Base::allocator_type allocator_type; 00418 00419 public: // Iterators 00420 typedef typename _Base::iterator iterator; 00421 typedef typename _Base::const_iterator const_iterator; 00422 00423 _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS; 00424 00425 protected: // Internal typedefs 00426 typedef pointer* _Map_pointer; 00427 #if defined (_STLP_NO_MOVE_SEMANTIC) 00428 typedef __false_type _Movable; 00429 #endif 00430 00431 public: // Basic accessors 00432 iterator begin() { return this->_M_start; } 00433 iterator end() { return this->_M_finish; } 00434 const_iterator begin() const { return const_iterator(this->_M_start); } 00435 const_iterator end() const { return const_iterator(this->_M_finish); } 00436 00437 reverse_iterator rbegin() { return reverse_iterator(this->_M_finish); } 00438 reverse_iterator rend() { return reverse_iterator(this->_M_start); } 00439 const_reverse_iterator rbegin() const 00440 { return const_reverse_iterator(this->_M_finish); } 00441 const_reverse_iterator rend() const 00442 { return const_reverse_iterator(this->_M_start); } 00443 00444 reference operator[](size_type __n) 00445 { return this->_M_start[difference_type(__n)]; } 00446 const_reference operator[](size_type __n) const 00447 { return this->_M_start[difference_type(__n)]; } 00448 00449 void _M_range_check(size_type __n) const { 00450 if (__n >= this->size()) 00451 __stl_throw_out_of_range("deque"); 00452 } 00453 reference at(size_type __n) 00454 { _M_range_check(__n); return (*this)[__n]; } 00455 const_reference at(size_type __n) const 00456 { _M_range_check(__n); return (*this)[__n]; } 00457 00458 reference front() { return *this->_M_start; } 00459 reference back() { 00460 iterator __tmp = this->_M_finish; 00461 --__tmp; 00462 return *__tmp; 00463 } 00464 const_reference front() const { return *this->_M_start; } 00465 const_reference back() const { 00466 const_iterator __tmp = this->_M_finish; 00467 --__tmp; 00468 return *__tmp; 00469 } 00470 00471 size_type size() const { return this->_M_finish - this->_M_start; } 00472 size_type max_size() const { return size_type(-1); } 00473 bool empty() const { return this->_M_finish == this->_M_start; } 00474 allocator_type get_allocator() const { return this->_M_map_size; } 00475 00476 public: // Constructor, destructor. 00477 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) 00478 explicit deque(const allocator_type& __a = allocator_type()) 00479 #else 00480 deque() 00481 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), 0) {} 00482 deque(const allocator_type& __a) 00483 #endif 00484 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, 0) {} 00485 00486 deque(const _Self& __x) 00487 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__x.get_allocator(), __x.size()) 00488 { _STLP_PRIV __ucopy(__x.begin(), __x.end(), this->_M_start); } 00489 00490 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) 00491 private: 00492 void _M_initialize(size_type __n, const value_type& __val = _STLP_DEFAULT_CONSTRUCTED(_Tp)) { 00493 typedef typename _TrivialInit<_Tp>::_Ret _TrivialInit; 00494 _M_fill_initialize(__val, _TrivialInit()); 00495 } 00496 public: 00497 explicit deque(size_type __n) 00498 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), __n) 00499 { _M_initialize(__n); } 00500 deque(size_type __n, const value_type& __val, const allocator_type& __a = allocator_type()) 00501 #else 00502 explicit deque(size_type __n) 00503 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), __n) { 00504 typedef typename _TrivialInit<_Tp>::_Ret _TrivialInit; 00505 _M_fill_initialize(_STLP_DEFAULT_CONSTRUCTED(_Tp), _TrivialInit()); 00506 } 00507 deque(size_type __n, const value_type& __val) 00508 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), __n) 00509 { _M_fill_initialize(__val, __false_type()); } 00510 deque(size_type __n, const value_type& __val, const allocator_type& __a) 00511 #endif 00512 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, __n) 00513 { _M_fill_initialize(__val, __false_type()); } 00514 00515 #if defined (_STLP_MEMBER_TEMPLATES) 00516 protected: 00517 template <class _Integer> 00518 void _M_initialize_dispatch(_Integer __n, _Integer __x, const __true_type&) { 00519 this->_M_initialize_map(__n); 00520 _M_fill_initialize(__x, __false_type()); 00521 } 00522 00523 template <class _InputIter> 00524 void _M_initialize_dispatch(_InputIter __first, _InputIter __last, 00525 const __false_type&) { 00526 _M_range_initialize(__first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIter)); 00527 } 00528 00529 public: 00530 // Check whether it's an integral type. If so, it's not an iterator. 00531 template <class _InputIterator> 00532 deque(_InputIterator __first, _InputIterator __last, 00533 const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL) 00534 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a) { 00535 typedef typename _IsIntegral<_InputIterator>::_Ret _Integral; 00536 _M_initialize_dispatch(__first, __last, _Integral()); 00537 } 00538 00539 # if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS) 00540 template <class _InputIterator> 00541 deque(_InputIterator __first, _InputIterator __last) 00542 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type()) { 00543 typedef typename _IsIntegral<_InputIterator>::_Ret _Integral; 00544 _M_initialize_dispatch(__first, __last, _Integral()); 00545 } 00546 # endif 00547 00548 #else 00549 deque(const value_type* __first, const value_type* __last, 00550 const allocator_type& __a = allocator_type() ) 00551 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, __last - __first) 00552 { _STLP_PRIV __ucopy(__first, __last, this->_M_start); } 00553 00554 deque(const_iterator __first, const_iterator __last, 00555 const allocator_type& __a = allocator_type() ) 00556 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, __last - __first) 00557 { _STLP_PRIV __ucopy(__first, __last, this->_M_start); } 00558 #endif /* _STLP_MEMBER_TEMPLATES */ 00559 00560 #if !defined (_STLP_NO_MOVE_SEMANTIC) 00561 deque(__move_source<_Self> src) 00562 : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__move_source<_Base>(src.get())) 00563 {} 00564 #endif 00565 00566 ~deque() 00567 { _STLP_STD::_Destroy_Range(this->_M_start, this->_M_finish); } 00568 00569 _Self& operator= (const _Self& __x); 00570 00571 void swap(_Self& __x) { 00572 _STLP_STD::swap(this->_M_start, __x._M_start); 00573 _STLP_STD::swap(this->_M_finish, __x._M_finish); 00574 this->_M_map.swap(__x._M_map); 00575 this->_M_map_size.swap(__x._M_map_size); 00576 } 00577 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) 00578 void _M_swap_workaround(_Self& __x) { swap(__x); } 00579 #endif 00580 00581 public: 00582 // assign(), a generalized assignment member function. Two 00583 // versions: one that takes a count, and one that takes a range. 00584 // The range version is a member template, so we dispatch on whether 00585 // or not the type is an integer. 00586 00587 void _M_fill_assign(size_type __n, const _Tp& __val) { 00588 if (__n > size()) { 00589 _STLP_STD::fill(begin(), end(), __val); 00590 insert(end(), __n - size(), __val); 00591 } 00592 else { 00593 erase(begin() + __n, end()); 00594 _STLP_STD::fill(begin(), end(), __val); 00595 } 00596 } 00597 00598 void assign(size_type __n, const _Tp& __val) { 00599 _M_fill_assign(__n, __val); 00600 } 00601 00602 #if defined (_STLP_MEMBER_TEMPLATES) 00603 template <class _InputIterator> 00604 void assign(_InputIterator __first, _InputIterator __last) { 00605 typedef typename _IsIntegral<_InputIterator>::_Ret _Integral; 00606 _M_assign_dispatch(__first, __last, _Integral()); 00607 } 00608 00609 private: // helper functions for assign() 00610 00611 template <class _Integer> 00612 void _M_assign_dispatch(_Integer __n, _Integer __val, 00613 const __true_type& /*_IsIntegral*/) 00614 { _M_fill_assign((size_type) __n, (_Tp) __val); } 00615 00616 template <class _InputIterator> 00617 void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, 00618 const __false_type& /*_IsIntegral*/) { 00619 _M_assign_aux(__first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIterator)); 00620 } 00621 00622 template <class _InputIter> 00623 void _M_assign_aux(_InputIter __first, _InputIter __last, const input_iterator_tag &) { 00624 iterator __cur = begin(); 00625 for ( ; __first != __last && __cur != end(); ++__cur, ++__first) 00626 *__cur = *__first; 00627 if (__first == __last) 00628 erase(__cur, end()); 00629 else 00630 insert(end(), __first, __last); 00631 } 00632 00633 template <class _ForwardIterator> 00634 void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, 00635 const forward_iterator_tag &) { 00636 #else 00637 void assign(const value_type *__first, const value_type *__last) { 00638 size_type __size = size(); 00639 size_type __len = __last - __first; 00640 if (__len > __size) { 00641 const value_type *__mid = __first + __size; 00642 _STLP_STD::copy(__first, __mid, begin()); 00643 insert(end(), __mid, __last); 00644 } 00645 else { 00646 erase(_STLP_STD::copy(__first, __last, begin()), end()); 00647 } 00648 } 00649 void assign(const_iterator __first, const_iterator __last) { 00650 typedef const_iterator _ForwardIterator; 00651 #endif /* _STLP_MEMBER_TEMPLATES */ 00652 size_type __len = _STLP_STD::distance(__first, __last); 00653 if (__len > size()) { 00654 _ForwardIterator __mid = __first; 00655 _STLP_STD::advance(__mid, size()); 00656 _STLP_STD::copy(__first, __mid, begin()); 00657 insert(end(), __mid, __last); 00658 } 00659 else { 00660 erase(_STLP_STD::copy(__first, __last, begin()), end()); 00661 } 00662 } 00663 00664 00665 public: // push_* and pop_* 00666 00667 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 00668 void push_back(const value_type& __t = _STLP_DEFAULT_CONSTRUCTED(_Tp)) { 00669 #else 00670 void push_back(const value_type& __t) { 00671 #endif 00672 if (this->_M_finish._M_cur != this->_M_finish._M_last - 1) { 00673 _Copy_Construct(this->_M_finish._M_cur, __t); 00674 ++this->_M_finish._M_cur; 00675 } 00676 else 00677 _M_push_back_aux_v(__t); 00678 } 00679 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 00680 void push_front(const value_type& __t = _STLP_DEFAULT_CONSTRUCTED(_Tp)) { 00681 #else 00682 void push_front(const value_type& __t) { 00683 #endif 00684 if (this->_M_start._M_cur != this->_M_start._M_first) { 00685 _Copy_Construct(this->_M_start._M_cur - 1, __t); 00686 --this->_M_start._M_cur; 00687 } 00688 else 00689 _M_push_front_aux_v(__t); 00690 } 00691 00692 #if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 00693 void push_back() { 00694 if (this->_M_finish._M_cur != this->_M_finish._M_last - 1) { 00695 _STLP_STD::_Construct(this->_M_finish._M_cur); 00696 ++this->_M_finish._M_cur; 00697 } 00698 else 00699 _M_push_back_aux(); 00700 } 00701 void push_front() { 00702 if (this->_M_start._M_cur != this->_M_start._M_first) { 00703 _STLP_STD::_Construct(this->_M_start._M_cur - 1); 00704 --this->_M_start._M_cur; 00705 } 00706 else 00707 _M_push_front_aux(); 00708 } 00709 #endif /*_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/ 00710 00711 void pop_back() { 00712 if (this->_M_finish._M_cur != this->_M_finish._M_first) { 00713 --this->_M_finish._M_cur; 00714 _STLP_STD::_Destroy(this->_M_finish._M_cur); 00715 } 00716 else { 00717 _M_pop_back_aux(); 00718 _STLP_STD::_Destroy(this->_M_finish._M_cur); 00719 } 00720 } 00721 00722 void pop_front() { 00723 _STLP_STD::_Destroy(this->_M_start._M_cur); 00724 _M_pop_front_aux(); 00725 } 00726 00727 public: // Insert 00728 00729 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 00730 iterator insert(iterator __pos, const value_type& __x = _STLP_DEFAULT_CONSTRUCTED(_Tp)) { 00731 #else 00732 iterator insert(iterator __pos, const value_type& __x) { 00733 #endif 00734 #if !defined (_STLP_NO_MOVE_SEMANTIC) 00735 typedef typename __move_traits<_Tp>::implemented _Movable; 00736 #endif 00737 if (__pos._M_cur == this->_M_start._M_cur) { 00738 push_front(__x); 00739 return this->_M_start; 00740 } 00741 else if (__pos._M_cur == this->_M_finish._M_cur) { 00742 push_back(__x); 00743 iterator __tmp = this->_M_finish; 00744 --__tmp; 00745 return __tmp; 00746 } 00747 else { 00748 return _M_fill_insert_aux(__pos, 1, __x, _Movable()); 00749 } 00750 } 00751 00752 #if defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS) 00753 iterator insert(iterator __pos) 00754 { return insert(__pos, _STLP_DEFAULT_CONSTRUCTED(_Tp)); } 00755 #endif /*_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/ 00756 00757 void insert(iterator __pos, size_type __n, const value_type& __x) 00758 { _M_fill_insert(__pos, __n, __x); } 00759 00760 protected: 00761 iterator _M_fill_insert_aux(iterator __pos, size_type __n, const value_type& __x, const __true_type& /*_Movable*/); 00762 iterator _M_fill_insert_aux(iterator __pos, size_type __n, const value_type& __x, const __false_type& /*_Movable*/); 00763 00764 void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x); 00765 00766 #if defined (_STLP_MEMBER_TEMPLATES) 00767 template <class _Integer> 00768 void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, 00769 const __true_type& /*_IsIntegral*/) { 00770 _M_fill_insert(__pos, (size_type) __n, (value_type) __x); 00771 } 00772 00773 template <class _InputIterator> 00774 void _M_insert_dispatch(iterator __pos, 00775 _InputIterator __first, _InputIterator __last, 00776 const __false_type& /*_IsIntegral*/) { 00777 _M_insert(__pos, __first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIterator)); 00778 } 00779 00780 public: 00781 // Check whether it's an integral type. If so, it's not an iterator. 00782 template <class _InputIterator> 00783 void insert(iterator __pos, _InputIterator __first, _InputIterator __last) { 00784 typedef typename _IsIntegral<_InputIterator>::_Ret _Integral; 00785 _M_insert_dispatch(__pos, __first, __last, _Integral()); 00786 } 00787 00788 #else /* _STLP_MEMBER_TEMPLATES */ 00789 void _M_insert_range_aux(iterator __pos, 00790 const value_type* __first, const value_type* __last, 00791 size_type __n, const __true_type& /*_Movable*/); 00792 void _M_insert_range_aux(iterator __pos, 00793 const value_type* __first, const value_type* __last, 00794 size_type __n, const __false_type& /*_Movable*/); 00795 void _M_insert_range_aux(iterator __pos, 00796 const_iterator __first, const_iterator __last, 00797 size_type __n, const __true_type& /*_Movable*/); 00798 void _M_insert_range_aux(iterator __pos, 00799 const_iterator __first, const_iterator __last, 00800 size_type __n, const __false_type& /*_Movable*/); 00801 public: 00802 void insert(iterator __pos, 00803 const value_type* __first, const value_type* __last); 00804 void insert(iterator __pos, 00805 const_iterator __first, const_iterator __last); 00806 00807 #endif /* _STLP_MEMBER_TEMPLATES */ 00808 00809 public: 00810 #if !defined(_STLP_DONT_SUP_DFLT_PARAM) 00811 void resize(size_type __new_size, 00812 const value_type& __x = _STLP_DEFAULT_CONSTRUCTED(_Tp)) { 00813 #else 00814 void resize(size_type __new_size, const value_type& __x) { 00815 #endif /*_STLP_DONT_SUP_DFLT_PARAM*/ 00816 const size_type __len = size(); 00817 if (__new_size < __len) 00818 erase(this->_M_start + __new_size, this->_M_finish); 00819 else 00820 insert(this->_M_finish, __new_size - __len, __x); 00821 } 00822 00823 #if defined (_STLP_DONT_SUP_DFLT_PARAM) 00824 void resize(size_type __new_size) 00825 { resize(__new_size, _STLP_DEFAULT_CONSTRUCTED(_Tp)); } 00826 #endif /*_STLP_DONT_SUP_DFLT_PARAM*/ 00827 00828 protected: 00829 iterator _M_erase(iterator __pos, const __true_type& /*_Movable*/); 00830 iterator _M_erase(iterator __pos, const __false_type& /*_Movable*/); 00831 00832 iterator _M_erase(iterator __first, iterator __last, const __true_type& /*_Movable*/); 00833 iterator _M_erase(iterator __first, iterator __last, const __false_type& /*_Movable*/); 00834 public: // Erase 00835 iterator erase(iterator __pos) { 00836 #if !defined (_STLP_NO_MOVE_SEMANTIC) 00837 typedef typename __move_traits<_Tp>::implemented _Movable; 00838 #endif 00839 return _M_erase(__pos, _Movable()); 00840 } 00841 iterator erase(iterator __first, iterator __last) { 00842 #if !defined (_STLP_NO_MOVE_SEMANTIC) 00843 typedef typename __move_traits<_Tp>::implemented _Movable; 00844 #endif 00845 if (__first == this->_M_start && __last == this->_M_finish) { 00846 clear(); 00847 return this->_M_finish; 00848 } 00849 else { 00850 if (__first == __last) 00851 return __first; 00852 return _M_erase(__first, __last, _Movable()); 00853 } 00854 } 00855 void clear(); 00856 00857 protected: // Internal construction/destruction 00858 00859 void _M_fill_initialize(const value_type& __val, const __true_type& /*_TrivialInit*/) 00860 {} 00861 void _M_fill_initialize(const value_type& __val, const __false_type& /*_TrivialInit*/); 00862 00863 #if defined (_STLP_MEMBER_TEMPLATES) 00864 template <class _InputIterator> 00865 void _M_range_initialize(_InputIterator __first, _InputIterator __last, 00866 const input_iterator_tag &) { 00867 this->_M_initialize_map(0); 00868 _STLP_TRY { 00869 for ( ; __first != __last; ++__first) 00870 push_back(*__first); 00871 } 00872 _STLP_UNWIND(clear()) 00873 } 00874 template <class _ForwardIterator> 00875 void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, 00876 const forward_iterator_tag &) { 00877 size_type __n = _STLP_STD::distance(__first, __last); 00878 this->_M_initialize_map(__n); 00879 _Map_pointer __cur_node = this->_M_start._M_node; 00880 _STLP_TRY { 00881 for (; __cur_node < this->_M_finish._M_node; ++__cur_node) { 00882 _ForwardIterator __mid = __first; 00883 _STLP_STD::advance(__mid, this->buffer_size()); 00884 _STLP_STD::uninitialized_copy(__first, __mid, *__cur_node); 00885 __first = __mid; 00886 } 00887 _STLP_STD::uninitialized_copy(__first, __last, this->_M_finish._M_first); 00888 } 00889 _STLP_UNWIND(_STLP_STD::_Destroy_Range(this->_M_start, iterator(*__cur_node, __cur_node))) 00890 } 00891 #endif /* _STLP_MEMBER_TEMPLATES */ 00892 00893 protected: // Internal push_* and pop_* 00894 00895 void _M_push_back_aux_v(const value_type&); 00896 void _M_push_front_aux_v(const value_type&); 00897 #if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 00898 void _M_push_back_aux(); 00899 void _M_push_front_aux(); 00900 #endif /*_STLP_DONT_SUP_DFLT_PARAM !_STLP_NO_ANACHRONISMS*/ 00901 void _M_pop_back_aux(); 00902 void _M_pop_front_aux(); 00903 00904 protected: // Internal insert functions 00905 00906 #if defined (_STLP_MEMBER_TEMPLATES) 00907 00908 template <class _InputIterator> 00909 void _M_insert(iterator __pos, 00910 _InputIterator __first, 00911 _InputIterator __last, 00912 const input_iterator_tag &) { 00913 _STLP_STD::copy(__first, __last, inserter(*this, __pos)); 00914 } 00915 00916 template <class _ForwardIterator> 00917 void _M_insert(iterator __pos, 00918 _ForwardIterator __first, _ForwardIterator __last, 00919 const forward_iterator_tag &) { 00920 #if !defined (_STLP_NO_MOVE_SEMANTIC) 00921 typedef typename __move_traits<_Tp>::implemented _Movable; 00922 #endif 00923 size_type __n = _STLP_STD::distance(__first, __last); 00924 if (__pos._M_cur == this->_M_start._M_cur) { 00925 iterator __new_start = _M_reserve_elements_at_front(__n); 00926 _STLP_TRY { 00927 uninitialized_copy(__first, __last, __new_start); 00928 this->_M_start = __new_start; 00929 } 00930 _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node)) 00931 } 00932 else if (__pos._M_cur == this->_M_finish._M_cur) { 00933 iterator __new_finish = _M_reserve_elements_at_back(__n); 00934 _STLP_TRY { 00935 uninitialized_copy(__first, __last, this->_M_finish); 00936 this->_M_finish = __new_finish; 00937 } 00938 _STLP_UNWIND(this->_M_destroy_nodes(this->_M_finish._M_node + 1, __new_finish._M_node + 1)) 00939 } 00940 else 00941 _M_insert_range_aux(__pos, __first, __last, __n, _Movable()); 00942 } 00943 00944 template <class _ForwardIterator> 00945 void _M_insert_range_aux(iterator __pos, 00946 _ForwardIterator __first, _ForwardIterator __last, 00947 size_type __n, const __true_type& /*_Movable*/) { 00948 const difference_type __elemsbefore = __pos - this->_M_start; 00949 size_type __length = size(); 00950 if (__elemsbefore <= difference_type(__length / 2)) { 00951 iterator __new_start = _M_reserve_elements_at_front(__n); 00952 __pos = this->_M_start + __elemsbefore; 00953 _STLP_TRY { 00954 iterator __dst = __new_start; 00955 iterator __src = this->_M_start; 00956 for (; __src != __pos; ++__dst, ++__src) { 00957 _STLP_STD::_Move_Construct(&(*__dst), *__src); 00958 _STLP_STD::_Destroy_Moved(&(*__src)); 00959 } 00960 this->_M_start = __new_start; 00961 uninitialized_copy(__first, __last, __dst); 00962 } 00963 _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node)) 00964 } 00965 else { 00966 iterator __new_finish = _M_reserve_elements_at_back(__n); 00967 const difference_type __elemsafter = difference_type(__length) - __elemsbefore; 00968 __pos = this->_M_finish - __elemsafter; 00969 _STLP_TRY { 00970 iterator __dst = __new_finish; 00971 iterator __src = this->_M_finish; 00972 for (--__src, --__dst; __src >= __pos; --__src, --__dst) { 00973 _STLP_STD::_Move_Construct(&(*__dst), *__src); 00974 _STLP_STD::_Destroy_Moved(&(*__src)); 00975 } 00976 this->_M_finish = __new_finish; 00977 uninitialized_copy(__first, __last, __pos); 00978 } 00979 _STLP_UNWIND(this->_M_destroy_nodes(this->_M_finish._M_node + 1, __new_finish._M_node + 1)) 00980 } 00981 } 00982 00983 template <class _ForwardIterator> 00984 void _M_insert_range_aux(iterator __pos, 00985 _ForwardIterator __first, _ForwardIterator __last, 00986 size_type __n, const __false_type& /*_Movable*/) { 00987 const difference_type __elemsbefore = __pos - this->_M_start; 00988 size_type __length = size(); 00989 if (__elemsbefore <= difference_type(__length / 2)) { 00990 iterator __new_start = _M_reserve_elements_at_front(__n); 00991 iterator __old_start = this->_M_start; 00992 __pos = this->_M_start + __elemsbefore; 00993 _STLP_TRY { 00994 if (__elemsbefore >= difference_type(__n)) { 00995 iterator __start_n = this->_M_start + difference_type(__n); 00996 _STLP_STD::uninitialized_copy(this->_M_start, __start_n, __new_start); 00997 this->_M_start = __new_start; 00998 _STLP_STD::copy(__start_n, __pos, __old_start); 00999 _STLP_STD::copy(__first, __last, __pos - difference_type(__n)); 01000 } 01001 else { 01002 _ForwardIterator __mid = __first; 01003 _STLP_STD::advance(__mid, difference_type(__n) - __elemsbefore); 01004 _STLP_PRIV __uninitialized_copy_copy(this->_M_start, __pos, __first, __mid, __new_start); 01005 this->_M_start = __new_start; 01006 _STLP_STD::copy(__mid, __last, __old_start); 01007 } 01008 } 01009 _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node)) 01010 } 01011 else { 01012 iterator __new_finish = _M_reserve_elements_at_back(__n); 01013 iterator __old_finish = this->_M_finish; 01014 const difference_type __elemsafter = difference_type(__length) - __elemsbefore; 01015 __pos = this->_M_finish - __elemsafter; 01016 _STLP_TRY { 01017 if (__elemsafter > difference_type(__n)) { 01018 iterator __finish_n = this->_M_finish - difference_type(__n); 01019 _STLP_STD::uninitialized_copy(__finish_n, this->_M_finish, this->_M_finish); 01020 this->_M_finish = __new_finish; 01021 _STLP_STD::copy_backward(__pos, __finish_n, __old_finish); 01022 _STLP_STD::copy(__first, __last, __pos); 01023 } 01024 else { 01025 _ForwardIterator __mid = __first; 01026 _STLP_STD::advance(__mid, __elemsafter); 01027 _STLP_PRIV __uninitialized_copy_copy(__mid, __last, __pos, this->_M_finish, this->_M_finish); 01028 this->_M_finish = __new_finish; 01029 _STLP_STD::copy(__first, __mid, __pos); 01030 } 01031 } 01032 _STLP_UNWIND(this->_M_destroy_nodes(this->_M_finish._M_node + 1, __new_finish._M_node + 1)) 01033 } 01034 } 01035 #endif /* _STLP_MEMBER_TEMPLATES */ 01036 01037 iterator _M_reserve_elements_at_front(size_type __n) { 01038 size_type __vacancies = this->_M_start._M_cur - this->_M_start._M_first; 01039 if (__n > __vacancies) 01040 _M_new_elements_at_front(__n - __vacancies); 01041 return this->_M_start - difference_type(__n); 01042 } 01043 01044 iterator _M_reserve_elements_at_back(size_type __n) { 01045 size_type __vacancies = (this->_M_finish._M_last - this->_M_finish._M_cur) - 1; 01046 if (__n > __vacancies) 01047 _M_new_elements_at_back(__n - __vacancies); 01048 return this->_M_finish + difference_type(__n); 01049 } 01050 01051 void _M_new_elements_at_front(size_type __new_elements); 01052 void _M_new_elements_at_back(size_type __new_elements); 01053 01054 protected: // Allocation of _M_map and nodes 01055 01056 // Makes sure the _M_map has space for new nodes. Does not actually 01057 // add the nodes. Can invalidate _M_map pointers. (And consequently, 01058 // deque iterators.) 01059 01060 void _M_reserve_map_at_back (size_type __nodes_to_add = 1) { 01061 if (__nodes_to_add + 1 > this->_M_map_size._M_data - (this->_M_finish._M_node - this->_M_map._M_data)) 01062 _M_reallocate_map(__nodes_to_add, false); 01063 } 01064 01065 void _M_reserve_map_at_front (size_type __nodes_to_add = 1) { 01066 if (__nodes_to_add > size_type(this->_M_start._M_node - this->_M_map._M_data)) 01067 _M_reallocate_map(__nodes_to_add, true); 01068 } 01069 01070 void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front); 01071 }; 01072 01073 #if defined (deque) 01074 # undef deque 01075 _STLP_MOVE_TO_STD_NAMESPACE 01076 #endif 01077 01078 _STLP_END_NAMESPACE 01079 01080 #if !defined (_STLP_LINK_TIME_INSTANTIATION) 01081 # include <stl/_deque.c> 01082 #endif 01083 01084 #if defined (_STLP_USE_PTR_SPECIALIZATIONS) 01085 # include <stl/pointers/_deque.h> 01086 #endif 01087 01088 #if defined (_STLP_DEBUG) 01089 # include <stl/debug/_deque.h> 01090 #endif 01091 01092 _STLP_BEGIN_NAMESPACE 01093 01094 #define _STLP_TEMPLATE_CONTAINER deque<_Tp, _Alloc> 01095 #define _STLP_TEMPLATE_HEADER template <class _Tp, class _Alloc> 01096 #include <stl/_relops_cont.h> 01097 #undef _STLP_TEMPLATE_CONTAINER 01098 #undef _STLP_TEMPLATE_HEADER 01099 01100 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_NO_MOVE_SEMANTIC) 01101 template <class _Tp, class _Alloc> 01102 struct __move_traits<deque<_Tp, _Alloc> > { 01103 typedef __true_type implemented; 01104 typedef typename __move_traits<_Alloc>::complete complete; 01105 }; 01106 #endif 01107 01108 _STLP_END_NAMESPACE 01109 01110 #endif /* _STLP_INTERNAL_DEQUE_H */ 01111 01112 // Local Variables: 01113 // mode:C++ 01114 // End: 01115 Generated on Sun May 27 2012 04:29:00 for ReactOS by
1.7.6.1
|