20 #ifndef _STLP_SPECIALIZED_DEQUE_H 21 #define _STLP_SPECIALIZED_DEQUE_H 23 #ifndef _STLP_POINTERS_SPEC_TOOLS_H 33 template <
class _StorageT,
class _ValueT>
77 #define DEQUE_IMPL _STLP_PTR_IMPL_NAME(deque) 78 #if defined (__BORLANDC__) || defined (__DMC__) 82 #if defined (_STLP_USE_TEMPLATE_EXPORT) && !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) 90 #if defined (_STLP_DEBUG) 91 # define deque _STLP_NON_DBG_NAME(deque) 96 template <
class _Tp, _STLP_DFL_TMPL_PARAM(_Alloc, allocator<_Tp>) >
98 #
if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (
deque)
135 {
return const_reverse_iterator(
end()); }
136 const_reverse_iterator
rend()
const 137 {
return const_reverse_iterator(
begin()); }
140 {
return cast_traits::to_value_type_ref(
_M_impl[
__n]); }
142 {
return cast_traits::to_value_type_cref(
_M_impl[
__n]); }
145 {
return cast_traits::to_value_type_ref(
_M_impl.at(
__n)); }
147 {
return cast_traits::to_value_type_cref(
_M_impl.at(
__n)); }
164 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) 172 #if defined (_STLP_DONT_SUP_DFLT_PARAM) 176 #if defined (_STLP_MEMBER_TEMPLATES) 177 template <
class _InputIterator>
178 deque(_InputIterator __first, _InputIterator
__last,
180 #if !defined (_STLP_USE_ITERATOR_WRAPPER) 186 #if defined (_STLP_USE_ITERATOR_WRAPPER) 191 # if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS) 192 template <
class _InputIterator>
193 deque(_InputIterator __first, _InputIterator
__last)
194 # if !defined (_STLP_USE_ITERATOR_WRAPPER) 215 #if !defined (_STLP_NO_MOVE_SEMANTIC) 223 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) 224 void _M_swap_workaround(
_Self& __x) {
swap(__x); }
231 #if defined (_STLP_MEMBER_TEMPLATES) 232 # if defined (_STLP_USE_ITERATOR_WRAPPER) 234 template <
class _Integer>
235 void _M_assign_dispatch(_Integer
__n, _Integer
__val,
239 template <
class _InputIterator>
240 void _M_assign_dispatch(_InputIterator __first, _InputIterator
__last,
248 template <
class _InputIterator>
249 void assign(_InputIterator __first, _InputIterator
__last) {
250 # if defined (_STLP_USE_ITERATOR_WRAPPER) 252 _M_assign_dispatch(__first,
__last, _Integral());
259 {
_M_impl.assign(cast_traits::to_storage_type_cptr(__first),
260 cast_traits::to_storage_type_cptr(
__last)); }
262 {
_M_impl.assign(ite_cast_traits::to_storage_type_cite(__first),
263 ite_cast_traits::to_storage_type_cite(
__last)); }
266 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 271 { _M_impl.push_back(cast_traits::to_storage_type_cref(__t)); } 273 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 278 { _M_impl.push_front(cast_traits::to_storage_type_cref(__t)); } 280 # if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 288 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 293 { return ite_cast_traits::to_value_type_ite(_M_impl.insert(ite_cast_traits::to_storage_type_ite(__pos), 294 cast_traits::to_storage_type_cref(__x))); }
296 #if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS) 301 {
_M_impl.insert(ite_cast_traits::to_storage_type_ite(__pos),
__n, cast_traits::to_storage_type_cref(__x)); }
303 #if defined (_STLP_MEMBER_TEMPLATES) 304 # if defined (_STLP_USE_ITERATOR_WRAPPER) 306 template <
class _Integer>
309 _M_impl.insert(ite_cast_traits::to_storage_type_ite(__pos),
__n,
__val);
312 template <
class _InputIterator>
313 void _M_insert_dispatch(
iterator __pos,
314 _InputIterator __first, _InputIterator
__last,
316 _M_impl.insert(ite_cast_traits::to_storage_type_ite(__pos),
324 template <
class _InputIterator>
326 # if defined (_STLP_USE_ITERATOR_WRAPPER) 329 _M_insert_dispatch(__pos, __first,
__last, _Integral());
331 _M_impl.insert(ite_cast_traits::to_storage_type_ite(__pos), __first,
__last);
338 _M_impl.insert(ite_cast_traits::to_storage_type_ite(__pos),
339 cast_traits::to_storage_type_cptr(__first),
340 cast_traits::to_storage_type_cptr(
__last));
344 _M_impl.insert(ite_cast_traits::to_storage_type_ite(__pos),
345 ite_cast_traits::to_storage_type_cite(__first),
346 ite_cast_traits::to_storage_type_cite(
__last));
351 #if !defined (_STLP_DONT_SUP_DFLT_PARAM) 356 {
_M_impl.resize(__new_size, cast_traits::to_storage_type_cref(__x)); }
358 #if defined (_STLP_DONT_SUP_DFLT_PARAM) 363 {
return ite_cast_traits::to_value_type_ite(
_M_impl.erase(ite_cast_traits::to_storage_type_ite(__pos))); }
366 {
return ite_cast_traits::to_value_type_ite(
_M_impl.erase(ite_cast_traits::to_storage_type_ite(__first),
367 ite_cast_traits::to_storage_type_ite(
__last))); }
380 #if defined (__BORLANDC__) || defined (__DMC__) #define _STLP_CONVERT_ALLOCATOR(__a, _Tp)
void assign(const_iterator __first, const_iterator __last)
_Base::allocator_type allocator_type
void push_front(const value_type &__t=_STLP_DEFAULT_CONSTRUCTED(_Tp))
ptrdiff_t difference_type
_STLP_TYPENAME _STLP_PRIV _StorageType< _Tp >::_Type _StorageType
static iterator to_value_type_ite(storage_iterator const &__ite)
const value_type * const_pointer
static storage_type * to_storage_type_ptr(value_type *__ptr)
void push_back(const value_type &__t=_STLP_DEFAULT_CONSTRUCTED(_Tp))
#define _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS
deque(__move_source< _Self > src)
void insert(iterator __pos, size_type __n, const value_type &__x)
_Alloc_traits< _StorageType, _Alloc >::allocator_type _StorageTypeAlloc
const_reference front() const
const value_type & const_reference
deque< _Tp, _Alloc > _Self
const_reverse_iterator rbegin() const
_Deque_iterator< _ValueT, _Const_traits< _ValueT > > const_iterator
#define _STLP_MOVE_TO_PRIV_NAMESPACE
void assign(size_type __n, const value_type &__val)
static value_type ** to_value_type_pptr(storage_type **__ptr)
static const_storage_iterator to_storage_type_cite(const_iterator const &__ite)
reference at(size_type __n)
#define _STLP_DEFAULT_CONSTRUCTED(_TTp)
const_iterator begin() const
const_reference at(size_type __n) const
void push_front(const value_type &__t=_STLP_DEFAULT_CONSTRUCTED(value_type))
_STLP_PRIV _CastTraits< _StorageType, _Tp > cast_traits
void insert(iterator __pos, const_pointer __first, const_pointer __last)
_STLP_INLINE_LOOP _InputIter __last
static value_type * to_value_type_ptr(storage_type *__ptr)
reference operator[](size_type __n)
deque(const_iterator __first, const_iterator __last, const allocator_type &__a=allocator_type())
const_reverse_iterator rend() const
reverse_iterator rbegin()
#define _STLP_MOVE_TO_STD_NAMESPACE
void get(int argc, const char *argv[])
void push_back(const value_type &__t=_STLP_DEFAULT_CONSTRUCTED(value_type))
#define _STLP_ALLOCATOR_TYPE_DFL
_STLP_INLINE_LOOP _InputIter const _Tp & __val
size_type max_size() const
#define _STLP_EXPORT_TEMPLATE_CLASS
void resize(size_type __new_size, const value_type &__x=_STLP_DEFAULT_CONSTRUCTED(value_type))
deque(const allocator_type &__a=allocator_type())
void assign(const_pointer __first, const_pointer __last)
_STLP_PRIV _Deque_base< IncompleteClass, _Alloc > _Base
_Base::const_iterator const_iterator
_Rebind_type::other allocator_type
#define _STLP_CLASS_DECLSPEC
iterator insert(iterator __pos, const value_type &__x=_STLP_DEFAULT_CONSTRUCTED(value_type))
const_reference operator[](size_type __n) const
_Deque_iterator< _StorageT, _Const_traits< _StorageT > > const_storage_iterator
static storage_iterator to_storage_type_ite(iterator const &__ite)
void assign(size_type __n, const _Tp &__val)
static const_iterator to_value_type_cite(const_storage_iterator const &__ite)
deque(const_pointer __first, const_pointer __last, const allocator_type &__a=allocator_type())
_Deque_iterator< _StorageT, _Nonconst_traits< _StorageT > > storage_iterator
#define _STLP_END_NAMESPACE
allocator_type get_allocator() const
iterator erase(iterator __first, iterator __last)
const_reference back() const
__kernel_ptrdiff_t ptrdiff_t
_CastTraits< _StorageT, _ValueT > cast_traits
const_iterator end() const
_Self & operator=(const _Self &__x)
#define _STLP_BEGIN_NAMESPACE
static storage_type ** to_storage_type_pptr(value_type **__ptr)
void insert(iterator __pos, const_iterator __first, const_iterator __last)
deque(size_type __n, const value_type &__val=_STLP_DEFAULT_CONSTRUCTED(value_type), const allocator_type &__a=allocator_type())
void resize(size_type __new_size, const value_type &__x=_STLP_DEFAULT_CONSTRUCTED(_Tp))
iterator erase(iterator __pos)
_STLP_PRIV _DequeIteCast< _StorageType, _Tp > ite_cast_traits
_Deque_iterator< _ValueT, _Nonconst_traits< _ValueT > > iterator
random_access_iterator_tag _Iterator_category
_STLP_PRIV DEQUE_IMPL< _StorageType, _StorageTypeAlloc > _Base
#define _STLP_FORCE_ALLOCATORS(a, y)