19720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/*
29720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Copyright (c) 2003
39720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Francois Dumont
49720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
59720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * This material is provided "as is", with absolutely no warranty expressed
69720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * or implied. Any use is at your own risk.
79720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
89720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to use or copy this software for any purpose is hereby granted
99720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * without fee, provided the above notices are retained on all copies.
109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * Permission to modify the code and to distribute modified code is granted,
119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * provided the above notices are retained, and a notice that the code was
129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block * modified is included with the above copyright notice.
139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *
149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block/* NOTE: This is an internal header file, included by other STL headers.
179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block *   You should not attempt to use it directly.
189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block */
199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_SPECIALIZED_VECTOR_H
219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define _STLP_SPECIALIZED_VECTOR_H
229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#ifndef _STLP_POINTERS_SPEC_TOOLS_H
249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  include <stl/pointers/_tools.h>
259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_BEGIN_NAMESPACE
289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#define VECTOR_IMPL _STLP_PTR_IMPL_NAME(vector)
309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_TEMPLATE_EXPORT) && !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS _STLP_PRIV _Vector_base<void*,allocator<void*> >;
339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_EXPORT_TEMPLATE_CLASS _STLP_PRIV VECTOR_IMPL<void*, allocator<void*> >;
349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_DEBUG)
379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  define vector _STLP_NON_DBG_NAME(vector)
389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_MOVE_TO_PRIV_NAMESPACE
399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
41e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scotttemplate <class _Tp, _STLP_DFL_TMPL_PARAM(_Alloc, allocator<_Tp>) >
429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockclass vector
439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (vector)
449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block             : public __stlport_class<vector<_Tp, _Alloc> >
459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block{
479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  /* In the vector implementation iterators are pointer which give a number
489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * of opportunities for optimization. To not break those optimizations
499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * iterators passed to template should not be wrapped for casting purpose.
509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * So vector implementation will always use a qualified void pointer type and
519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   * won't use iterator wrapping.
529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block   */
53e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  typedef _STLP_TYPENAME _STLP_PRIV _StorageType<_Tp>::_QualifiedType _StorageType;
549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Alloc_traits<_StorageType, _Alloc>::allocator_type _StorageTypeAlloc;
559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLP_PRIV VECTOR_IMPL<_StorageType, _StorageTypeAlloc> _Base;
569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef vector<_Tp, _Alloc> _Self;
579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _STLP_PRIV _CastTraits<_StorageType, _Tp> cast_traits;
599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockpublic:
619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef _Tp value_type;
629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef value_type* pointer;
639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const value_type* const_pointer;
649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef value_type* iterator;
659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const value_type* const_iterator;
669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef value_type& reference;
679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef const value_type& const_reference;
689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef size_t size_type;
699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef ptrdiff_t difference_type;
709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef random_access_iterator_tag _Iterator_category;
719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS;
739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _STLP_FORCE_ALLOCATORS(value_type, _Alloc)
749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  typedef typename _Alloc_traits<value_type, _Alloc>::allocator_type allocator_type;
759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  allocator_type get_allocator() const
779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _STLP_CONVERT_ALLOCATOR(_M_impl.get_allocator(), value_type); }
789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator begin()             { return cast_traits::to_value_type_ptr(_M_impl.begin()); }
809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator begin() const { return cast_traits::to_value_type_cptr(_M_impl.begin()); }
819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator end()               { return cast_traits::to_value_type_ptr(_M_impl.end()); }
829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_iterator end() const   { return cast_traits::to_value_type_cptr(_M_impl.end()); }
839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  reverse_iterator rbegin()              { return reverse_iterator(end()); }
859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_reverse_iterator rbegin() const  { return const_reverse_iterator(end()); }
869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  reverse_iterator rend()                { return reverse_iterator(begin()); }
879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_reverse_iterator rend() const    { return const_reverse_iterator(begin()); }
889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type size() const        { return _M_impl.size(); }
909720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type max_size() const    { return _M_impl.max_size(); }
919720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
929720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  size_type capacity() const    { return _M_impl.capacity(); }
939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  bool empty() const            { return _M_impl.empty(); }
949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  reference operator[](size_type __n) { return cast_traits::to_value_type_ref(_M_impl[__n]); }
969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_reference operator[](size_type __n) const { return cast_traits::to_value_type_cref(_M_impl[__n]); }
979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  reference front()             { return cast_traits::to_value_type_ref(_M_impl.front()); }
999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_reference front() const { return cast_traits::to_value_type_cref(_M_impl.front()); }
1009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  reference back()              { return cast_traits::to_value_type_ref(_M_impl.back()); }
1019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_reference back() const  { return cast_traits::to_value_type_cref(_M_impl.back()); }
1029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  reference at(size_type __n) { return cast_traits::to_value_type_ref(_M_impl.at(__n)); }
1049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  const_reference at(size_type __n) const { return cast_traits::to_value_type_cref(_M_impl.at(__n)); }
1059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  explicit vector(const allocator_type& __a = allocator_type())
1079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_impl(_STLP_CONVERT_ALLOCATOR(__a, _StorageType)) {}
1089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined(_STLP_DONT_SUP_DFLT_PARAM)
1109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  explicit vector(size_type __n, const value_type& __val = _STLP_DEFAULT_CONSTRUCTED(value_type),
1119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  vector(size_type __n, const value_type& __val,
1139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_DONT_SUP_DFLT_PARAM*/
1149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block         const allocator_type& __a = allocator_type())
1159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_impl(__n, cast_traits::to_storage_type_cref(__val),
1169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block      _STLP_CONVERT_ALLOCATOR(__a, _StorageType)) {}
1179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined(_STLP_DONT_SUP_DFLT_PARAM)
1199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  explicit vector(size_type __n)
1209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_impl(__n, allocator_type() ) {}
121e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
1229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  vector(const _Self& __x)
1249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_impl(__x._M_impl) {}
1259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
126e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if !defined (_STLP_NO_MOVE_SEMANTIC)
1279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  explicit vector(__move_source<_Self> src)
1289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_impl(__move_source<_Base>(src.get()._M_impl)) {}
129e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
1309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATES)
1329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  vector(_InputIterator __first, _InputIterator __last,
1349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block         const allocator_type& __a _STLP_ALLOCATOR_TYPE_DFL )
1359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  : _M_impl(__first, __last,
1369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block            _STLP_CONVERT_ALLOCATOR(__a, _StorageType)) {}
1379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
1399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  vector(_InputIterator __first, _InputIterator __last)
1419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_impl(__first, __last) {}
1429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  endif
1439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1449720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1459720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  vector(const_iterator __first, const_iterator __last,
1469720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block         const allocator_type& __a = allocator_type())
1479720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    : _M_impl(cast_traits::to_storage_type_cptr(__first), cast_traits::to_storage_type_cptr(__last),
1489720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block              _STLP_CONVERT_ALLOCATOR(__a, _StorageType)) {}
1499720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_MEMBER_TEMPLATES */
1509720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1519720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Self& operator=(const _Self& __x) { _M_impl = __x._M_impl; return *this; }
1529720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1539720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void reserve(size_type __n) {_M_impl.reserve(__n);}
1549720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void assign(size_type __n, const value_type& __val)
1559720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_impl.assign(__n, cast_traits::to_storage_type_cref(__val)); }
1569720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1579720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATES)
1589720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1599720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void assign(_InputIterator __first, _InputIterator __last)
1609720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_impl.assign(__first, __last); }
1619720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1629720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void assign(const_iterator __first, const_iterator __last) {
1639720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _M_impl.assign(cast_traits::to_storage_type_cptr(__first),
1649720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                   cast_traits::to_storage_type_cptr(__last));
1659720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
1669720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_MEMBER_TEMPLATES */
1679720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1689720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
1699720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void push_back(const value_type& __x = _STLP_DEFAULT_CONSTRUCTED(value_type))
1709720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1719720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void push_back(const value_type& __x)
1729720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*!_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
1739720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_impl.push_back(cast_traits::to_storage_type_cref(__x)); }
1749720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1759720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
1769720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator insert(iterator __pos, const value_type& __x = _STLP_DEFAULT_CONSTRUCTED(value_type))
1779720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1789720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator insert(iterator __pos, const value_type& __x)
1799720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*!_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
1809720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return cast_traits::to_value_type_ptr(_M_impl.insert(cast_traits::to_storage_type_ptr(__pos),
1819720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                                                         cast_traits::to_storage_type_cref(__x))); }
1829720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1839720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
1849720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void push_back() { _M_impl.push_back(); }
1859720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator insert(iterator __pos)
1869720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { return _M_impl.insert(cast_traits::to_storage_type_ptr(__pos)); }
1879720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
1889720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1899720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void swap(_Self& __x) { _M_impl.swap(__x._M_impl); }
190e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
191e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott  void _M_swap_workaround(_Self& __x) { swap(__x); }
192e46c9386c4f79aa40185f79a19fc5b2a7ef528b3Patrick Scott#endif
1939720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
1949720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (_STLP_MEMBER_TEMPLATES)
1959720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  template <class _InputIterator>
1969720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(iterator __pos, _InputIterator __first, _InputIterator __last)
1979720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_impl.insert(cast_traits::to_storage_type_ptr(__pos), __first, __last); }
1989720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
1999720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert(iterator __pos, const_iterator __first, const_iterator __last) {
2009720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _M_impl.insert(cast_traits::to_storage_type_ptr(__pos), cast_traits::to_storage_type_cptr(__first),
2019720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                                                            cast_traits::to_storage_type_cptr(__last));
2029720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
2039720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
2049720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2059720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void insert (iterator __pos, size_type __n, const value_type& __x) {
2069720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    _M_impl.insert(cast_traits::to_storage_type_ptr(__pos), __n, cast_traits::to_storage_type_cref(__x));
2079720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
2089720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2099720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void pop_back() {_M_impl.pop_back();}
2109720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator erase(iterator __pos)
2119720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  {return cast_traits::to_value_type_ptr(_M_impl.erase(cast_traits::to_storage_type_ptr(__pos)));}
2129720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  iterator erase(iterator __first, iterator __last) {
2139720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block    return cast_traits::to_value_type_ptr(_M_impl.erase(cast_traits::to_storage_type_ptr(__first),
2149720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block                                                        cast_traits::to_storage_type_ptr(__last)));
2159720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  }
2169720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2179720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if !defined(_STLP_DONT_SUP_DFLT_PARAM)
2189720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void resize(size_type __new_size, const value_type& __x = _STLP_DEFAULT_CONSTRUCTED(value_type))
2199720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#else
2209720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void resize(size_type __new_size, const value_type& __x)
2219720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_DONT_SUP_DFLT_PARAM*/
2229720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  { _M_impl.resize(__new_size, cast_traits::to_storage_type_cref(__x)); }
2239720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2249720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined(_STLP_DONT_SUP_DFLT_PARAM)
2259720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void resize(size_type __new_size) { _M_impl.resize(__new_size); }
2269720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /*_STLP_DONT_SUP_DFLT_PARAM*/
2279720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2289720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  void clear() { _M_impl.clear(); }
2299720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2309720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Blockprivate:
2319720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block  _Base _M_impl;
2329720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block};
2339720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2349720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#if defined (vector)
2359720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#  undef vector
2369720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_MOVE_TO_STD_NAMESPACE
2379720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif
2389720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2399720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#undef VECTOR_IMPL
2409720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2419720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block_STLP_END_NAMESPACE
2429720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block
2439720d5f59b9c1f5d1b9ecbc9173dbcb71bd557beSteve Block#endif /* _STLP_SPECIALIZED_VECTOR_H */
244