epoc32/include/tools/stlport/stl/_deque.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2  *
     3  * Copyright (c) 1994
     4  * Hewlett-Packard Company
     5  *
     6  * Copyright (c) 1996,1997
     7  * Silicon Graphics Computer Systems, Inc.
     8  *
     9  * Copyright (c) 1997
    10  * Moscow Center for SPARC Technology
    11  *
    12  * Copyright (c) 1999
    13  * Boris Fomitchev
    14  *
    15  * This material is provided "as is", with absolutely no warranty expressed
    16  * or implied. Any use is at your own risk.
    17  *
    18  * Permission to use or copy this software for any purpose is hereby granted
    19  * without fee, provided the above notices are retained on all copies.
    20  * Permission to modify the code and to distribute modified code is granted,
    21  * provided the above notices are retained, and a notice that the code was
    22  * modified is included with the above copyright notice.
    23  *
    24  */
    25 
    26 /* NOTE: This is an internal header file, included by other STL headers.
    27  *   You should not attempt to use it directly.
    28  */
    29 
    30 #ifndef _STLP_INTERNAL_DEQUE_H
    31 #define _STLP_INTERNAL_DEQUE_H
    32 
    33 #ifndef _STLP_INTERNAL_ALGOBASE_H
    34 #  include <stl/_algobase.h>
    35 #endif
    36 
    37 #ifndef _STLP_INTERNAL_ALLOC_H
    38 #  include <stl/_alloc.h>
    39 #endif
    40 
    41 #ifndef _STLP_INTERNAL_ITERATOR_H
    42 #  include <stl/_iterator.h>
    43 #endif
    44 
    45 #ifndef _STLP_INTERNAL_UNINITIALIZED_H
    46 #  include <stl/_uninitialized.h>
    47 #endif
    48 
    49 #ifndef _STLP_RANGE_ERRORS_H
    50 #  include <stl/_range_errors.h>
    51 #endif
    52 
    53 /* Class invariants:
    54  *  For any nonsingular iterator i:
    55  *    i.node is the address of an element in the map array.  The
    56  *      contents of i.node is a pointer to the beginning of a node.
    57  *    i.first == *(i.node)
    58  *    i.last  == i.first + node_size
    59  *    i.cur is a pointer in the range [i.first, i.last).  NOTE:
    60  *      the implication of this is that i.cur is always a dereferenceable
    61  *      pointer, even if i is a past-the-end iterator.
    62  *  Start and Finish are always nonsingular iterators.  NOTE: this means
    63  *    that an empty deque must have one node, and that a deque
    64  *    with N elements, where N is the buffer size, must have two nodes.
    65  *  For every node other than start.node and finish.node, every element
    66  *    in the node is an initialized object.  If start.node == finish.node,
    67  *    then [start.cur, finish.cur) are initialized objects, and
    68  *    the elements outside that range are uninitialized storage.  Otherwise,
    69  *    [start.cur, start.last) and [finish.first, finish.cur) are initialized
    70  *    objects, and [start.first, start.cur) and [finish.cur, finish.last)
    71  *    are uninitialized storage.
    72  *  [map, map + map_size) is a valid, non-empty range.
    73  *  [start.node, finish.node] is a valid range contained within
    74  *    [map, map + map_size).
    75  *  A pointer in the range [map, map + map_size) points to an allocated node
    76  *    if and only if the pointer is in the range [start.node, finish.node].
    77  */
    78 
    79 _STLP_BEGIN_NAMESPACE
    80 
    81 _STLP_MOVE_TO_PRIV_NAMESPACE
    82 
    83 template <class _Tp>
    84 struct _Deque_iterator_base {
    85 
    86   enum _Constants {
    87     _blocksize = _MAX_BYTES,
    88     __buffer_size = (sizeof(_Tp) < (size_t)_blocksize ?
    89                   ( (size_t)_blocksize / sizeof(_Tp)) : size_t(1))
    90   };
    91 
    92   typedef random_access_iterator_tag iterator_category;
    93 
    94   typedef _Tp value_type;
    95   typedef size_t size_type;
    96   typedef ptrdiff_t difference_type;
    97 
    98   typedef value_type** _Map_pointer;
    99 
   100   typedef _Deque_iterator_base< _Tp > _Self;
   101 
   102   value_type* _M_cur;
   103   value_type* _M_first;
   104   value_type* _M_last;
   105   _Map_pointer _M_node;
   106 
   107   _Deque_iterator_base(value_type* __x, _Map_pointer __y)
   108     : _M_cur(__x), _M_first(*__y),
   109       _M_last(*__y + __buffer_size), _M_node(__y) {}
   110 
   111   _Deque_iterator_base() : _M_cur(0), _M_first(0), _M_last(0), _M_node(0) {}
   112 
   113 // see comment in doc/README.evc4
   114 // TODO: since this still applies to the MIPS compiler delivered with VC8,
   115 // but isn't mentioned in its (yet nonexistant) README.evc8.
   116 #if defined (_STLP_MSVC) && (_STLP_MSVC <= 1400) && defined (MIPS) && defined (NDEBUG)
   117   _Deque_iterator_base(_Deque_iterator_base const& __other)
   118   : _M_cur(__other._M_cur), _M_first(__other._M_first),
   119     _M_last(__other._M_last), _M_node(__other._M_node) {}
   120 #endif
   121 
   122   difference_type _M_subtract(const _Self& __x) const {
   123     return difference_type(__buffer_size) * (_M_node - __x._M_node - 1) +
   124       (_M_cur - _M_first) + (__x._M_last - __x._M_cur);
   125   }
   126 
   127   void _M_increment() {
   128     if (++_M_cur == _M_last) {
   129       _M_set_node(_M_node + 1);
   130       _M_cur = _M_first;
   131     }
   132   }
   133 
   134   void _M_decrement() {
   135     if (_M_cur == _M_first) {
   136       _M_set_node(_M_node - 1);
   137       _M_cur = _M_last;
   138     }
   139     --_M_cur;
   140   }
   141 
   142   void _M_advance(difference_type __n) {
   143     difference_type __offset = __n + (_M_cur - _M_first);
   144     if (__offset >= 0 && __offset < difference_type(__buffer_size))
   145       _M_cur += __n;
   146     else {
   147       difference_type __node_offset =
   148         __offset > 0 ? __offset / __buffer_size
   149                    : -difference_type((-__offset - 1) / __buffer_size) - 1;
   150       _M_set_node(_M_node + __node_offset);
   151       _M_cur = _M_first +
   152 
   153         (__offset - __node_offset * difference_type(__buffer_size));
   154     }
   155   }
   156 
   157   void _M_set_node(_Map_pointer __new_node) {
   158     _M_last = (_M_first = *(_M_node = __new_node)) + difference_type(__buffer_size);
   159   }
   160 };
   161 
   162 
   163 template <class _Tp, class _Traits>
   164 struct _Deque_iterator : public _Deque_iterator_base< _Tp> {
   165   typedef random_access_iterator_tag iterator_category;
   166   typedef _Tp value_type;
   167   typedef typename _Traits::reference  reference;
   168   typedef typename _Traits::pointer    pointer;
   169   typedef size_t size_type;
   170   typedef ptrdiff_t difference_type;
   171   typedef value_type** _Map_pointer;
   172 
   173   typedef _Deque_iterator_base< _Tp > _Base;
   174   typedef _Deque_iterator<_Tp, _Traits> _Self;
   175   typedef typename _Traits::_NonConstTraits     _NonConstTraits;
   176   typedef _Deque_iterator<_Tp, _NonConstTraits> iterator;
   177   typedef typename _Traits::_ConstTraits        _ConstTraits;
   178   typedef _Deque_iterator<_Tp, _ConstTraits>    const_iterator;
   179 
   180   _Deque_iterator(value_type* __x, _Map_pointer __y) :
   181     _Deque_iterator_base<value_type>(__x,__y) {}
   182 
   183   _Deque_iterator() {}
   184   //copy constructor for iterator and constructor from iterator for const_iterator
   185   _Deque_iterator(const iterator& __x) :
   186     _Deque_iterator_base<value_type>(__x) {}
   187 
   188   reference operator*() const {
   189     return *this->_M_cur;
   190   }
   191 
   192   _STLP_DEFINE_ARROW_OPERATOR
   193 
   194   difference_type operator-(const const_iterator& __x) const { return this->_M_subtract(__x); }
   195 
   196   _Self& operator++() { this->_M_increment(); return *this; }
   197   _Self operator++(int)  {
   198     _Self __tmp = *this;
   199     ++*this;
   200     return __tmp;
   201   }
   202 
   203   _Self& operator--() { this->_M_decrement(); return *this; }
   204   _Self operator--(int) {
   205     _Self __tmp = *this;
   206     --*this;
   207     return __tmp;
   208   }
   209 
   210   _Self& operator+=(difference_type __n) { this->_M_advance(__n); return *this; }
   211   _Self operator+(difference_type __n) const {
   212     _Self __tmp = *this;
   213     return __tmp += __n;
   214   }
   215 
   216   _Self& operator-=(difference_type __n) { return *this += -__n; }
   217   _Self operator-(difference_type __n) const {
   218     _Self __tmp = *this;
   219     return __tmp -= __n;
   220   }
   221 
   222   reference operator[](difference_type __n) const { return *(*this + __n); }
   223 };
   224 
   225 
   226 template <class _Tp, class _Traits>
   227 inline _Deque_iterator<_Tp, _Traits> _STLP_CALL
   228 operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Traits>& __x)
   229 { return __x + __n; }
   230 
   231 
   232 #if defined (_STLP_USE_SEPARATE_RELOPS_NAMESPACE)
   233 template <class _Tp>
   234 inline bool _STLP_CALL
   235 operator==(const _Deque_iterator_base<_Tp >& __x,
   236            const _Deque_iterator_base<_Tp >& __y)
   237 { return __x._M_cur == __y._M_cur; }
   238 
   239 template <class _Tp>
   240 inline bool _STLP_CALL
   241 operator < (const _Deque_iterator_base<_Tp >& __x,
   242             const _Deque_iterator_base<_Tp >& __y) {
   243   return (__x._M_node == __y._M_node) ?
   244     (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node);
   245 }
   246 
   247 template <class _Tp>
   248 inline bool _STLP_CALL
   249 operator!=(const _Deque_iterator_base<_Tp >& __x,
   250            const _Deque_iterator_base<_Tp >& __y)
   251 { return __x._M_cur != __y._M_cur; }
   252 
   253 template <class _Tp>
   254 inline bool _STLP_CALL
   255 operator>(const _Deque_iterator_base<_Tp >& __x,
   256           const _Deque_iterator_base<_Tp >& __y)
   257 { return __y < __x; }
   258 
   259 template <class _Tp>
   260 inline bool  _STLP_CALL operator>=(const _Deque_iterator_base<_Tp >& __x,
   261                                    const _Deque_iterator_base<_Tp >& __y)
   262 { return !(__x < __y); }
   263 
   264 template <class _Tp>
   265 inline bool  _STLP_CALL operator<=(const _Deque_iterator_base<_Tp >& __x,
   266                                    const _Deque_iterator_base<_Tp >& __y)
   267 { return !(__y < __x); }
   268 
   269 #else /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
   270 
   271 template <class _Tp, class _Traits1, class _Traits2>
   272 inline bool  _STLP_CALL
   273 operator==(const _Deque_iterator<_Tp, _Traits1 >& __x,
   274            const _Deque_iterator<_Tp, _Traits2 >& __y)
   275 { return __x._M_cur == __y._M_cur; }
   276 
   277 template <class _Tp, class _Traits1, class _Traits2>
   278 inline bool _STLP_CALL
   279 operator < (const _Deque_iterator<_Tp, _Traits1 >& __x,
   280             const _Deque_iterator<_Tp, _Traits2 >& __y) {
   281   return (__x._M_node == __y._M_node) ?
   282     (__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node);
   283 }
   284 
   285 template <class _Tp>
   286 inline bool _STLP_CALL
   287 operator!=(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x,
   288            const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y)
   289 { return __x._M_cur != __y._M_cur; }
   290 
   291 template <class _Tp>
   292 inline bool _STLP_CALL
   293 operator>(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x,
   294           const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y)
   295 { return __y < __x; }
   296 
   297 template <class _Tp>
   298 inline bool  _STLP_CALL
   299 operator>=(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x,
   300            const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y)
   301 { return !(__x < __y); }
   302 
   303 template <class _Tp>
   304 inline bool _STLP_CALL
   305 operator<=(const _Deque_iterator<_Tp, _Nonconst_traits<_Tp> >& __x,
   306            const _Deque_iterator<_Tp, _Const_traits<_Tp> >& __y)
   307 { return !(__y < __x); }
   308 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
   309 
   310 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
   311 _STLP_MOVE_TO_STD_NAMESPACE
   312 template <class _Tp, class _Traits>
   313 struct __type_traits<_STLP_PRIV _Deque_iterator<_Tp, _Traits> > {
   314   typedef __false_type   has_trivial_default_constructor;
   315   typedef __true_type    has_trivial_copy_constructor;
   316   typedef __true_type    has_trivial_assignment_operator;
   317   typedef __true_type    has_trivial_destructor;
   318   typedef __false_type   is_POD_type;
   319 };
   320 _STLP_MOVE_TO_PRIV_NAMESPACE
   321 #endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
   322 
   323 #if defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES)
   324 _STLP_MOVE_TO_STD_NAMESPACE
   325 template <class _Tp, class _Traits> inline _Tp*  _STLP_CALL
   326 value_type(const _STLP_PRIV _Deque_iterator<_Tp, _Traits  >&) { return (_Tp*)0; }
   327 template <class _Tp, class _Traits> inline random_access_iterator_tag _STLP_CALL
   328 iterator_category(const _STLP_PRIV _Deque_iterator<_Tp, _Traits  >&) { return random_access_iterator_tag(); }
   329 template <class _Tp, class _Traits> inline ptrdiff_t* _STLP_CALL
   330 distance_type(const _STLP_PRIV _Deque_iterator<_Tp, _Traits  >&) { return 0; }
   331 _STLP_MOVE_TO_PRIV_NAMESPACE
   332 #endif
   333 
   334 /* Deque base class.  It has two purposes.  First, its constructor
   335  *  and destructor allocate (but don't initialize) storage.  This makes
   336  *  exception safety easier.  Second, the base class encapsulates all of
   337  *  the differences between SGI-style allocators and standard-conforming
   338  *  allocators.
   339  */
   340 
   341 template <class _Tp, class _Alloc>
   342 class _Deque_base {
   343   typedef _Deque_base<_Tp, _Alloc> _Self;
   344 public:
   345   typedef _Tp value_type;
   346   _STLP_FORCE_ALLOCATORS(_Tp, _Alloc)
   347   typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type  allocator_type;
   348   typedef _STLP_alloc_proxy<size_t, value_type,  allocator_type> _Alloc_proxy;
   349 
   350   typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type _Map_alloc_type;
   351   typedef _STLP_alloc_proxy<value_type**, value_type*, _Map_alloc_type> _Map_alloc_proxy;
   352 
   353   typedef _Deque_iterator<_Tp, _Nonconst_traits<_Tp> > iterator;
   354   typedef _Deque_iterator<_Tp, _Const_traits<_Tp> >    const_iterator;
   355 
   356   static size_t _STLP_CALL buffer_size() { return (size_t)_Deque_iterator_base<_Tp>::__buffer_size; }
   357 
   358   _Deque_base(const allocator_type& __a, size_t __num_elements)
   359     : _M_start(), _M_finish(), _M_map(_STLP_CONVERT_ALLOCATOR(__a, _Tp*), 0),
   360       _M_map_size(__a, (size_t)0)
   361   { _M_initialize_map(__num_elements); }
   362 
   363   _Deque_base(const allocator_type& __a)
   364     : _M_start(), _M_finish(), _M_map(_STLP_CONVERT_ALLOCATOR(__a, _Tp*), 0),
   365       _M_map_size(__a, (size_t)0) {}
   366 
   367   _Deque_base(__move_source<_Self> src)
   368     : _M_start(src.get()._M_start), _M_finish(src.get()._M_finish),
   369       _M_map(__move_source<_Map_alloc_proxy>(src.get()._M_map)),
   370       _M_map_size(__move_source<_Alloc_proxy>(src.get()._M_map_size)) {
   371     src.get()._M_map._M_data = 0;
   372     src.get()._M_map_size._M_data = 0;
   373     src.get()._M_finish = src.get()._M_start;
   374   }
   375 
   376   ~_Deque_base();
   377 
   378 protected:
   379   void _M_initialize_map(size_t);
   380   void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
   381   void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
   382   enum { _S_initial_map_size = 8 };
   383 
   384 protected:
   385   iterator _M_start;
   386   iterator _M_finish;
   387   _Map_alloc_proxy  _M_map;
   388   _Alloc_proxy      _M_map_size;
   389 };
   390 
   391 #if defined (_STLP_USE_PTR_SPECIALIZATIONS)
   392 #  define deque _STLP_PTR_IMPL_NAME(deque)
   393 #elif defined (_STLP_DEBUG)
   394 #  define deque _STLP_NON_DBG_NAME(deque)
   395 #else
   396 _STLP_MOVE_TO_STD_NAMESPACE
   397 #endif
   398 
   399 template <class _Tp, _STLP_DEFAULT_ALLOCATOR_SELECT(_Tp) >
   400 class deque : protected _STLP_PRIV _Deque_base<_Tp, _Alloc>
   401 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (deque)
   402             , public __stlport_class<deque<_Tp, _Alloc> >
   403 #endif
   404 {
   405   typedef _STLP_PRIV _Deque_base<_Tp, _Alloc> _Base;
   406   typedef deque<_Tp, _Alloc> _Self;
   407 public:                         // Basic types
   408   typedef _Tp value_type;
   409   typedef value_type* pointer;
   410   typedef const value_type* const_pointer;
   411   typedef value_type& reference;
   412   typedef const value_type& const_reference;
   413   typedef size_t size_type;
   414   typedef ptrdiff_t difference_type;
   415   typedef random_access_iterator_tag _Iterator_category;
   416   _STLP_FORCE_ALLOCATORS(_Tp, _Alloc)
   417   typedef typename _Base::allocator_type allocator_type;
   418 
   419 public:                         // Iterators
   420   typedef typename _Base::iterator       iterator;
   421   typedef typename _Base::const_iterator const_iterator;
   422 
   423   _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS;
   424 
   425 protected:                      // Internal typedefs
   426   typedef pointer* _Map_pointer;
   427   typedef typename __type_traits<_Tp>::has_trivial_assignment_operator _TrivialAss;
   428   typedef typename __type_traits<_Tp>::has_trivial_copy_constructor _TrivialCpy;
   429   typedef typename _TrivialInit<_Tp>::_Ret _TrivialInit;
   430 #if !defined (_STLP_NO_MOVE_SEMANTIC)
   431   typedef typename __move_traits<_Tp>::implemented _Movable;
   432 #else
   433   typedef __false_type _Movable;
   434 #endif
   435 
   436 public:                         // Basic accessors
   437   iterator begin() { return this->_M_start; }
   438   iterator end() { return this->_M_finish; }
   439   const_iterator begin() const { return const_iterator(this->_M_start); }
   440   const_iterator end() const { return const_iterator(this->_M_finish); }
   441 
   442   reverse_iterator rbegin() { return reverse_iterator(this->_M_finish); }
   443   reverse_iterator rend() { return reverse_iterator(this->_M_start); }
   444   const_reverse_iterator rbegin() const
   445     { return const_reverse_iterator(this->_M_finish); }
   446   const_reverse_iterator rend() const
   447     { return const_reverse_iterator(this->_M_start); }
   448 
   449   reference operator[](size_type __n)
   450     { return this->_M_start[difference_type(__n)]; }
   451   const_reference operator[](size_type __n) const
   452     { return this->_M_start[difference_type(__n)]; }
   453 
   454   void _M_range_check(size_type __n) const {
   455     if (__n >= this->size())
   456       __stl_throw_out_of_range("deque");
   457   }
   458   reference at(size_type __n)
   459     { _M_range_check(__n); return (*this)[__n]; }
   460   const_reference at(size_type __n) const
   461     { _M_range_check(__n); return (*this)[__n]; }
   462 
   463   reference front() { return *this->_M_start; }
   464   reference back() {
   465     iterator __tmp = this->_M_finish;
   466     --__tmp;
   467     return *__tmp;
   468   }
   469   const_reference front() const { return *this->_M_start; }
   470   const_reference back() const {
   471     const_iterator __tmp = this->_M_finish;
   472     --__tmp;
   473     return *__tmp;
   474   }
   475 
   476   size_type size() const { return this->_M_finish - this->_M_start; }
   477   size_type max_size() const { return size_type(-1); }
   478   bool empty() const { return this->_M_finish == this->_M_start; }
   479   allocator_type get_allocator() const { return this->_M_map_size; }
   480 
   481 public:                         // Constructor, destructor.
   482 #if !defined (_STLP_DONT_SUP_DFLT_PARAM)
   483   explicit deque(const allocator_type& __a = allocator_type())
   484 #else
   485   deque()
   486     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), 0) {}
   487   deque(const allocator_type& __a)
   488 #endif
   489     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, 0) {}
   490 
   491   deque(const _Self& __x)
   492     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__x.get_allocator(), __x.size())
   493   { _STLP_PRIV __ucopy(__x.begin(), __x.end(), this->_M_start); }
   494 
   495 #if !defined (_STLP_DONT_SUP_DFLT_PARAM)
   496 private:
   497   void _M_initialize(size_type __n, const value_type& __val = _STLP_DEFAULT_CONSTRUCTED(_Tp))
   498   { _M_fill_initialize(__val, _TrivialInit()); }
   499 public:
   500   explicit deque(size_type __n)
   501     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), __n)
   502   { _M_initialize(__n); }
   503   deque(size_type __n, const value_type& __val, const allocator_type& __a = allocator_type())
   504 #else
   505   explicit deque(size_type __n)
   506     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), __n)
   507   { _M_fill_initialize(_STLP_DEFAULT_CONSTRUCTED(_Tp), _TrivialInit()); }
   508   deque(size_type __n, const value_type& __val)
   509     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type(), __n)
   510   { _M_fill_initialize(__val, __false_type()); }
   511   deque(size_type __n, const value_type& __val, const allocator_type& __a)
   512 #endif
   513     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, __n)
   514   { _M_fill_initialize(__val, __false_type()); }
   515 
   516 #if defined (_STLP_MEMBER_TEMPLATES)
   517 protected:
   518   template <class _Integer>
   519   void _M_initialize_dispatch(_Integer __n, _Integer __x, const __true_type&) {
   520     this->_M_initialize_map(__n);
   521     _M_fill_initialize(__x, __false_type());
   522   }
   523 
   524   template <class _InputIter>
   525   void _M_initialize_dispatch(_InputIter __first, _InputIter __last,
   526                               const __false_type&) {
   527     _M_range_initialize(__first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIter));
   528   }
   529 
   530 public:
   531   // Check whether it's an integral type.  If so, it's not an iterator.
   532   template <class _InputIterator>
   533   deque(_InputIterator __first, _InputIterator __last,
   534         const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL)
   535     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a) {
   536     typedef typename _IsIntegral<_InputIterator>::_Ret _Integral;
   537     _M_initialize_dispatch(__first, __last, _Integral());
   538   }
   539 
   540 #  if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
   541   template <class _InputIterator>
   542   deque(_InputIterator __first, _InputIterator __last)
   543     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(allocator_type()) {
   544     typedef typename _IsIntegral<_InputIterator>::_Ret _Integral;
   545     _M_initialize_dispatch(__first, __last, _Integral());
   546   }
   547 #  endif
   548 
   549 #else
   550   deque(const value_type* __first, const value_type* __last,
   551         const allocator_type& __a = allocator_type() )
   552     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, __last - __first)
   553   { _STLP_PRIV __ucopy(__first, __last, this->_M_start); }
   554 
   555   deque(const_iterator __first, const_iterator __last,
   556         const allocator_type& __a = allocator_type() )
   557     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__a, __last - __first)
   558   { _STLP_PRIV __ucopy(__first, __last, this->_M_start); }
   559 #endif /* _STLP_MEMBER_TEMPLATES */
   560 
   561   deque(__move_source<_Self> src)
   562     : _STLP_PRIV _Deque_base<_Tp, _Alloc>(__move_source<_Base>(src.get()))
   563   {}
   564 
   565   ~deque()
   566   { _STLP_STD::_Destroy_Range(this->_M_start, this->_M_finish); }
   567 
   568   _Self& operator= (const _Self& __x);
   569 
   570   void swap(_Self& __x) {
   571     _STLP_STD::swap(this->_M_start, __x._M_start);
   572     _STLP_STD::swap(this->_M_finish, __x._M_finish);
   573     this->_M_map.swap(__x._M_map);
   574     this->_M_map_size.swap(__x._M_map_size);
   575   }
   576 
   577 public:
   578   // assign(), a generalized assignment member function.  Two
   579   // versions: one that takes a count, and one that takes a range.
   580   // The range version is a member template, so we dispatch on whether
   581   // or not the type is an integer.
   582 
   583   void _M_fill_assign(size_type __n, const _Tp& __val) {
   584     if (__n > size()) {
   585       _STLP_STD::fill(begin(), end(), __val);
   586       insert(end(), __n - size(), __val);
   587     }
   588     else {
   589       erase(begin() + __n, end());
   590       _STLP_STD::fill(begin(), end(), __val);
   591     }
   592   }
   593 
   594   void assign(size_type __n, const _Tp& __val) {
   595     _M_fill_assign(__n, __val);
   596   }
   597 
   598 #if defined (_STLP_MEMBER_TEMPLATES)
   599   template <class _InputIterator>
   600   void assign(_InputIterator __first, _InputIterator __last) {
   601     typedef typename _IsIntegral<_InputIterator>::_Ret _Integral;
   602     _M_assign_dispatch(__first, __last, _Integral());
   603   }
   604 
   605 private:                        // helper functions for assign()
   606 
   607   template <class _Integer>
   608   void _M_assign_dispatch(_Integer __n, _Integer __val,
   609                           const __true_type& /*_IsIntegral*/)
   610   { _M_fill_assign((size_type) __n, (_Tp) __val); }
   611 
   612   template <class _InputIterator>
   613   void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
   614                           const __false_type& /*_IsIntegral*/) {
   615     _M_assign_aux(__first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIterator));
   616   }
   617 
   618   template <class _InputIter>
   619   void _M_assign_aux(_InputIter __first, _InputIter __last, const input_iterator_tag &) {
   620     iterator __cur = begin();
   621     for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
   622       *__cur = *__first;
   623     if (__first == __last)
   624       erase(__cur, end());
   625     else
   626       insert(end(), __first, __last);
   627   }
   628 
   629   template <class _ForwardIterator>
   630   void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
   631                      const forward_iterator_tag &) {
   632 #else
   633   void assign(const value_type *__first, const value_type *__last) {
   634     size_type __size = size();
   635     size_type __len = __last - __first;
   636     if (__len > __size) {
   637       const value_type *__mid = __first + __size;
   638       copy(__first, __mid, begin());
   639       insert(end(), __mid, __last);
   640     }
   641     else {
   642       erase(copy(__first, __last, begin()), end());
   643     }
   644   }
   645   void assign(const_iterator __first, const_iterator __last) {
   646     typedef const_iterator _ForwardIterator;
   647 #endif /* _STLP_MEMBER_TEMPLATES */
   648     size_type __len = distance(__first, __last);
   649     if (__len > size()) {
   650       _ForwardIterator __mid = __first;
   651       advance(__mid, size());
   652       copy(__first, __mid, begin());
   653       insert(end(), __mid, __last);
   654     }
   655     else {
   656       erase(copy(__first, __last, begin()), end());
   657     }
   658   }
   659 
   660 
   661 public:                         // push_* and pop_*
   662 
   663 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
   664   void push_back(const value_type& __t = _STLP_DEFAULT_CONSTRUCTED(_Tp)) {
   665 #else
   666   void push_back(const value_type& __t) {
   667 #endif /*!_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
   668     if (this->_M_finish._M_cur != this->_M_finish._M_last - 1) {
   669       _Copy_Construct(this->_M_finish._M_cur, __t);
   670       ++this->_M_finish._M_cur;
   671     }
   672     else
   673       _M_push_back_aux_v(__t);
   674   }
   675 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
   676   void push_front(const value_type& __t = _STLP_DEFAULT_CONSTRUCTED(_Tp))   {
   677 #else
   678   void push_front(const value_type& __t)   {
   679 #endif /*!_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
   680     if (this->_M_start._M_cur != this->_M_start._M_first) {
   681       _Copy_Construct(this->_M_start._M_cur - 1, __t);
   682       --this->_M_start._M_cur;
   683     }
   684     else
   685       _M_push_front_aux_v(__t);
   686   }
   687 
   688 #if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
   689   void push_back() {
   690     if (this->_M_finish._M_cur != this->_M_finish._M_last - 1) {
   691       _STLP_STD::_Construct(this->_M_finish._M_cur);
   692       ++this->_M_finish._M_cur;
   693     }
   694     else
   695       _M_push_back_aux();
   696   }
   697   void push_front() {
   698     if (this->_M_start._M_cur != this->_M_start._M_first) {
   699       _STLP_STD::_Construct(this->_M_start._M_cur - 1);
   700       --this->_M_start._M_cur;
   701     }
   702     else
   703       _M_push_front_aux();
   704   }
   705 #endif /*_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
   706 
   707   void pop_back() {
   708     if (this->_M_finish._M_cur != this->_M_finish._M_first) {
   709       --this->_M_finish._M_cur;
   710       _STLP_STD::_Destroy(this->_M_finish._M_cur);
   711     }
   712     else {
   713       _M_pop_back_aux();
   714       _STLP_STD::_Destroy(this->_M_finish._M_cur);
   715     }
   716   }
   717 
   718   void pop_front() {
   719     _STLP_STD::_Destroy(this->_M_start._M_cur);
   720     _M_pop_front_aux();
   721   }
   722 
   723 public:                         // Insert
   724 
   725 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
   726   iterator insert(iterator __pos, const value_type& __x = _STLP_DEFAULT_CONSTRUCTED(_Tp)) {
   727 #else
   728   iterator insert(iterator __pos, const value_type& __x) {
   729 #endif /*!_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
   730     if (__pos._M_cur == this->_M_start._M_cur) {
   731       push_front(__x);
   732       return this->_M_start;
   733     }
   734     else if (__pos._M_cur == this->_M_finish._M_cur) {
   735       push_back(__x);
   736       iterator __tmp = this->_M_finish;
   737       --__tmp;
   738       return __tmp;
   739     }
   740     else {
   741       return _M_fill_insert_aux(__pos, 1, __x, _Movable());
   742     }
   743   }
   744 
   745 #if defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
   746   iterator insert(iterator __pos)
   747   { return insert(__pos, _STLP_DEFAULT_CONSTRUCTED(_Tp)); }
   748 #endif /*_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
   749 
   750   void insert(iterator __pos, size_type __n, const value_type& __x)
   751   { _M_fill_insert(__pos, __n, __x); }
   752 
   753 protected:
   754   iterator _M_fill_insert_aux(iterator __pos, size_type __n, const value_type& __x, const __true_type& /*_Movable*/);
   755   iterator _M_fill_insert_aux(iterator __pos, size_type __n, const value_type& __x, const __false_type& /*_Movable*/);
   756 
   757   void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
   758 
   759 #if defined (_STLP_MEMBER_TEMPLATES)
   760   template <class _Integer>
   761   void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
   762                           const __true_type& /*_IsIntegral*/) {
   763     _M_fill_insert(__pos, (size_type) __n, (value_type) __x);
   764   }
   765 
   766   template <class _InputIterator>
   767   void _M_insert_dispatch(iterator __pos,
   768                           _InputIterator __first, _InputIterator __last,
   769                           const __false_type& /*_IsIntegral*/) {
   770     _M_insert(__pos, __first, __last, _STLP_ITERATOR_CATEGORY(__first, _InputIterator));
   771   }
   772 
   773 public:
   774   // Check whether it's an integral type.  If so, it's not an iterator.
   775   template <class _InputIterator>
   776   void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
   777     typedef typename _IsIntegral<_InputIterator>::_Ret _Integral;
   778     _M_insert_dispatch(__pos, __first, __last, _Integral());
   779   }
   780 
   781 #else /* _STLP_MEMBER_TEMPLATES */
   782   void _M_insert_range_aux(iterator __pos,
   783                            const value_type* __first, const value_type* __last,
   784                            size_type __n, const __true_type& /*_Movable*/);
   785   void _M_insert_range_aux(iterator __pos,
   786                            const value_type* __first, const value_type* __last,
   787                            size_type __n, const __false_type& /*_Movable*/);
   788   void _M_insert_range_aux(iterator __pos,
   789                            const_iterator __first, const_iterator __last,
   790                            size_type __n, const __true_type& /*_Movable*/);
   791   void _M_insert_range_aux(iterator __pos,
   792                            const_iterator __first, const_iterator __last,
   793                            size_type __n, const __false_type& /*_Movable*/);
   794 public:
   795   void insert(iterator __pos,
   796               const value_type* __first, const value_type* __last);
   797   void insert(iterator __pos,
   798               const_iterator __first, const_iterator __last);
   799 
   800 #endif /* _STLP_MEMBER_TEMPLATES */
   801 
   802 public:
   803 #if !defined(_STLP_DONT_SUP_DFLT_PARAM)
   804   void resize(size_type __new_size,
   805               const value_type& __x = _STLP_DEFAULT_CONSTRUCTED(_Tp)) {
   806 #else
   807   void resize(size_type __new_size, const value_type& __x) {
   808 #endif /*_STLP_DONT_SUP_DFLT_PARAM*/
   809     const size_type __len = size();
   810     if (__new_size < __len)
   811       erase(this->_M_start + __new_size, this->_M_finish);
   812     else
   813       insert(this->_M_finish, __new_size - __len, __x);
   814   }
   815 
   816 #if defined (_STLP_DONT_SUP_DFLT_PARAM)
   817   void resize(size_type __new_size)
   818   { resize(__new_size, _STLP_DEFAULT_CONSTRUCTED(_Tp)); }
   819 #endif /*_STLP_DONT_SUP_DFLT_PARAM*/
   820 
   821 protected:
   822   iterator _M_erase(iterator __pos, const __true_type& /*_Movable*/);
   823   iterator _M_erase(iterator __pos, const __false_type& /*_Movable*/);
   824 
   825   iterator _M_erase(iterator __first, iterator __last, const __true_type& /*_Movable*/);
   826   iterator _M_erase(iterator __first, iterator __last, const __false_type& /*_Movable*/);
   827 public:                         // Erase
   828   iterator erase(iterator __pos) {
   829     return _M_erase(__pos, _Movable());
   830   }
   831   iterator erase(iterator __first, iterator __last) {
   832     if (__first == this->_M_start && __last == this->_M_finish) {
   833       clear();
   834       return this->_M_finish;
   835     }
   836     else {
   837       if (__first == __last)
   838         return __first;
   839       return _M_erase(__first, __last, _Movable());
   840     }
   841   }
   842   void clear();
   843 
   844 protected:                        // Internal construction/destruction
   845 
   846   void _M_fill_initialize(const value_type& __val, const __true_type& /*_TrivialInit*/)
   847   {}
   848   void _M_fill_initialize(const value_type& __val, const __false_type& /*_TrivialInit*/);
   849 
   850 #if defined (_STLP_MEMBER_TEMPLATES)
   851   template <class _InputIterator>
   852   void _M_range_initialize(_InputIterator __first, _InputIterator __last,
   853                            const input_iterator_tag &) {
   854     this->_M_initialize_map(0);
   855     _STLP_TRY {
   856       for ( ; __first != __last; ++__first)
   857         push_back(*__first);
   858     }
   859     _STLP_UNWIND(clear())
   860   }
   861   template <class _ForwardIterator>
   862   void  _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
   863                             const forward_iterator_tag &)  {
   864    size_type __n = distance(__first, __last);
   865    this->_M_initialize_map(__n);
   866    _Map_pointer __cur_node = this->_M_start._M_node;
   867    _STLP_TRY {
   868     for (; __cur_node < this->_M_finish._M_node; ++__cur_node) {
   869       _ForwardIterator __mid = __first;
   870       advance(__mid, this->buffer_size());
   871       uninitialized_copy(__first, __mid, *__cur_node);
   872       __first = __mid;
   873     }
   874     uninitialized_copy(__first, __last, this->_M_finish._M_first);
   875    }
   876   _STLP_UNWIND(_STLP_STD::_Destroy_Range(this->_M_start, iterator(*__cur_node, __cur_node)))
   877  }
   878 #endif /* _STLP_MEMBER_TEMPLATES */
   879 
   880 protected:                        // Internal push_* and pop_*
   881 
   882   void _M_push_back_aux_v(const value_type&);
   883   void _M_push_front_aux_v(const value_type&);
   884 #if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
   885   void _M_push_back_aux();
   886   void _M_push_front_aux();
   887 #endif /*_STLP_DONT_SUP_DFLT_PARAM !_STLP_NO_ANACHRONISMS*/
   888   void _M_pop_back_aux();
   889   void _M_pop_front_aux();
   890 
   891 protected:                        // Internal insert functions
   892 
   893 #if defined (_STLP_MEMBER_TEMPLATES)
   894 
   895   template <class _InputIterator>
   896   void _M_insert(iterator __pos,
   897                 _InputIterator __first,
   898                 _InputIterator __last,
   899                 const input_iterator_tag &) {
   900     copy(__first, __last, inserter(*this, __pos));
   901   }
   902 
   903   template <class _ForwardIterator>
   904   void  _M_insert(iterator __pos,
   905                   _ForwardIterator __first, _ForwardIterator __last,
   906                   const forward_iterator_tag &) {
   907     size_type __n = distance(__first, __last);
   908     if (__pos._M_cur == this->_M_start._M_cur) {
   909       iterator __new_start = _M_reserve_elements_at_front(__n);
   910       _STLP_TRY {
   911         uninitialized_copy(__first, __last, __new_start);
   912         this->_M_start = __new_start;
   913       }
   914       _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node))
   915     }
   916     else if (__pos._M_cur == this->_M_finish._M_cur) {
   917       iterator __new_finish = _M_reserve_elements_at_back(__n);
   918       _STLP_TRY {
   919         uninitialized_copy(__first, __last, this->_M_finish);
   920         this->_M_finish = __new_finish;
   921       }
   922       _STLP_UNWIND(this->_M_destroy_nodes(this->_M_finish._M_node + 1, __new_finish._M_node + 1))
   923     }
   924     else
   925       _M_insert_range_aux(__pos, __first, __last, __n, _Movable());
   926   }
   927 
   928   template <class _ForwardIterator>
   929   void _M_insert_range_aux(iterator __pos,
   930                            _ForwardIterator __first, _ForwardIterator __last,
   931                            size_type __n, const __true_type& /*_Movable*/) {
   932     const difference_type __elemsbefore = __pos - this->_M_start;
   933     size_type __length = size();
   934     if (__elemsbefore <= difference_type(__length / 2)) {
   935       iterator __new_start = _M_reserve_elements_at_front(__n);
   936       __pos = this->_M_start + __elemsbefore;
   937       _STLP_TRY {
   938         iterator __dst = __new_start;
   939         iterator __src = this->_M_start;
   940         for (; __src != __pos; ++__dst, ++__src) {
   941           _STLP_STD::_Move_Construct(&(*__dst), *__src);
   942           _STLP_STD::_Destroy_Moved(&(*__src));
   943         }
   944         this->_M_start = __new_start;
   945         uninitialized_copy(__first, __last, __dst);
   946       }
   947       _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node))
   948     }
   949     else {
   950       iterator __new_finish = _M_reserve_elements_at_back(__n);
   951       const difference_type __elemsafter = difference_type(__length) - __elemsbefore;
   952       __pos = this->_M_finish - __elemsafter;
   953       _STLP_TRY {
   954         iterator __dst = __new_finish;
   955         iterator __src = this->_M_finish;
   956         for (--__src, --__dst; __src >= __pos; --__src, --__dst) {
   957           _STLP_STD::_Move_Construct(&(*__dst), *__src);
   958           _STLP_STD::_Destroy_Moved(&(*__src));
   959         }
   960         this->_M_finish = __new_finish;
   961         uninitialized_copy(__first, __last, __pos);
   962       }
   963       _STLP_UNWIND(this->_M_destroy_nodes(this->_M_finish._M_node + 1, __new_finish._M_node + 1))
   964     }
   965   }
   966 
   967   template <class _ForwardIterator>
   968   void _M_insert_range_aux(iterator __pos,
   969                            _ForwardIterator __first, _ForwardIterator __last,
   970                            size_type __n, const __false_type& /*_Movable*/) {
   971     const difference_type __elemsbefore = __pos - this->_M_start;
   972     size_type __length = size();
   973     if (__elemsbefore <= difference_type(__length / 2)) {
   974       iterator __new_start = _M_reserve_elements_at_front(__n);
   975       iterator __old_start = this->_M_start;
   976       __pos = this->_M_start + __elemsbefore;
   977       _STLP_TRY {
   978         if (__elemsbefore >= difference_type(__n)) {
   979           iterator __start_n = this->_M_start + difference_type(__n);
   980           uninitialized_copy(this->_M_start, __start_n, __new_start);
   981           this->_M_start = __new_start;
   982           copy(__start_n, __pos, __old_start);
   983           copy(__first, __last, __pos - difference_type(__n));
   984         }
   985         else {
   986           _ForwardIterator __mid = __first;
   987           advance(__mid, difference_type(__n) - __elemsbefore);
   988           _STLP_PRIV __uninitialized_copy_copy(this->_M_start, __pos, __first, __mid, __new_start);
   989           this->_M_start = __new_start;
   990           copy(__mid, __last, __old_start);
   991         }
   992       }
   993       _STLP_UNWIND(this->_M_destroy_nodes(__new_start._M_node, this->_M_start._M_node))
   994     }
   995     else {
   996       iterator __new_finish = _M_reserve_elements_at_back(__n);
   997       iterator __old_finish = this->_M_finish;
   998       const difference_type __elemsafter = difference_type(__length) - __elemsbefore;
   999       __pos = this->_M_finish - __elemsafter;
  1000       _STLP_TRY {
  1001         if (__elemsafter > difference_type(__n)) {
  1002           iterator __finish_n = this->_M_finish - difference_type(__n);
  1003           uninitialized_copy(__finish_n, this->_M_finish, this->_M_finish);
  1004           this->_M_finish = __new_finish;
  1005           copy_backward(__pos, __finish_n, __old_finish);
  1006           copy(__first, __last, __pos);
  1007         }
  1008         else {
  1009           _ForwardIterator __mid = __first;
  1010           advance(__mid, __elemsafter);
  1011           _STLP_PRIV __uninitialized_copy_copy(__mid, __last, __pos, this->_M_finish, this->_M_finish);
  1012           this->_M_finish = __new_finish;
  1013           copy(__first, __mid, __pos);
  1014         }
  1015       }
  1016       _STLP_UNWIND(this->_M_destroy_nodes(this->_M_finish._M_node + 1, __new_finish._M_node + 1))
  1017     }
  1018   }
  1019 #endif /* _STLP_MEMBER_TEMPLATES */
  1020 
  1021   iterator _M_reserve_elements_at_front(size_type __n) {
  1022     size_type __vacancies = this->_M_start._M_cur - this->_M_start._M_first;
  1023     if (__n > __vacancies)
  1024       _M_new_elements_at_front(__n - __vacancies);
  1025     return this->_M_start - difference_type(__n);
  1026   }
  1027 
  1028   iterator _M_reserve_elements_at_back(size_type __n) {
  1029     size_type __vacancies = (this->_M_finish._M_last - this->_M_finish._M_cur) - 1;
  1030     if (__n > __vacancies)
  1031       _M_new_elements_at_back(__n - __vacancies);
  1032     return this->_M_finish + difference_type(__n);
  1033   }
  1034 
  1035   void _M_new_elements_at_front(size_type __new_elements);
  1036   void _M_new_elements_at_back(size_type __new_elements);
  1037 
  1038 protected:                      // Allocation of _M_map and nodes
  1039 
  1040   // Makes sure the _M_map has space for new nodes.  Does not actually
  1041   //  add the nodes.  Can invalidate _M_map pointers.  (And consequently,
  1042   //  deque iterators.)
  1043 
  1044   void _M_reserve_map_at_back (size_type __nodes_to_add = 1) {
  1045     if (__nodes_to_add + 1 > this->_M_map_size._M_data - (this->_M_finish._M_node - this->_M_map._M_data))
  1046       _M_reallocate_map(__nodes_to_add, false);
  1047   }
  1048 
  1049   void _M_reserve_map_at_front (size_type __nodes_to_add = 1) {
  1050     if (__nodes_to_add > size_type(this->_M_start._M_node - this->_M_map._M_data))
  1051       _M_reallocate_map(__nodes_to_add, true);
  1052   }
  1053 
  1054   void _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front);
  1055 };
  1056 
  1057 #if defined (deque)
  1058 #  undef deque
  1059 _STLP_MOVE_TO_STD_NAMESPACE
  1060 #endif
  1061 
  1062 _STLP_END_NAMESPACE
  1063 
  1064 #if !defined (_STLP_LINK_TIME_INSTANTIATION)
  1065 #  include <stl/_deque.c>
  1066 #endif
  1067 
  1068 #if defined (_STLP_USE_PTR_SPECIALIZATIONS)
  1069 #  include <stl/pointers/_deque.h>
  1070 #endif
  1071 
  1072 #if defined (_STLP_DEBUG)
  1073 #  include <stl/debug/_deque.h>
  1074 #endif
  1075 
  1076 _STLP_BEGIN_NAMESPACE
  1077 
  1078 #define _STLP_TEMPLATE_CONTAINER deque<_Tp, _Alloc>
  1079 #define _STLP_TEMPLATE_HEADER    template <class _Tp, class _Alloc>
  1080 #include <stl/_relops_cont.h>
  1081 #undef _STLP_TEMPLATE_CONTAINER
  1082 #undef _STLP_TEMPLATE_HEADER
  1083 
  1084 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
  1085 template <class _Tp, class _Alloc>
  1086 struct __move_traits<deque<_Tp, _Alloc> > {
  1087   typedef __stlp_movable implemented;
  1088   typedef typename __move_traits<_Alloc>::complete complete;
  1089 };
  1090 #endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
  1091 
  1092 _STLP_END_NAMESPACE
  1093 
  1094 #endif /* _STLP_INTERNAL_DEQUE_H */
  1095 
  1096 // Local Variables:
  1097 // mode:C++
  1098 // End:
  1099