30#ifndef _STLP_INTERNAL_LIST_IMPL_H
31#define _STLP_INTERNAL_LIST_IMPL_H
33#ifndef _STLP_INTERNAL_ALGOBASE_H
37#ifndef _STLP_INTERNAL_ALLOC_H
41#ifndef _STLP_INTERNAL_ITERATOR_H
45#ifndef _STLP_INTERNAL_CONSTRUCT_H
49#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
62template <
class _Dummy>
70#if defined (_STLP_USE_TEMPLATE_EXPORT)
96template<
class _Tp,
class _Traits>
99 typedef typename _Traits::pointer
pointer;
148#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
150template <
class _Tp,
class _Traits>
161#if defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES)
163template <
class _Tp,
class _Traits>
173template <
class _Tp,
class _Alloc>
191#if !defined (_STLP_NO_MOVE_SEMANTIC)
194 if (
src.get().empty())
198 src.get()._M_empty_initialize();
219#if defined (_STLP_USE_PTR_SPECIALIZATIONS)
220# define list _STLP_PTR_IMPL_NAME(list)
221#elif defined (_STLP_DEBUG)
222# define list _STLP_NON_DBG_NAME(list)
227template <
class _Tp, _STLP_DFL_TMPL_PARAM(_Alloc, allocator<_Tp>) >
235template <
class _Tp,
class _Alloc,
class _Predicate>
238template <
class _Tp,
class _Alloc,
class _BinaryPredicate>
241template <
class _Tp,
class _Alloc,
class _StrictWeakOrdering>
243 _StrictWeakOrdering __comp);
245template <
class _Tp,
class _Alloc,
class _StrictWeakOrdering>
252template <
class _Tp,
class _Alloc>
254#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (list)
280#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
293#if defined (_STLP_DONT_SUP_DFLT_PARAM)
297 _STLP_STD::_Construct(&__p->_M_data);
305#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
315 list(size_type
__n, const_reference
__val,
const allocator_type& __a)
320#if defined (_STLP_MEMBER_TEMPLATES)
323 template <
class _InputIterator>
324 list(_InputIterator __first, _InputIterator
__last,
329# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
330 template <
class _InputIterator>
331 list(_InputIterator __first, _InputIterator
__last)
346#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
351 list(
const allocator_type& __a)
358#if !defined (_STLP_NO_MOVE_SEMANTIC)
365 _Self& operator = (
const _Self& __x);
374 const_reverse_iterator
rbegin()
const {
return const_reverse_iterator(
end()); }
377 const_reverse_iterator
rend()
const {
return const_reverse_iterator(
begin()); }
392 __x._M_node._M_swap_alloc(this->_M_node);
393 __x._M_node._M_data._M_next = this->_M_node.
_M_data._M_next;
394 __x._M_node._M_data._M_next->_M_prev = &__x._M_node._M_data;
395 __x._M_node._M_data._M_prev = this->_M_node.
_M_data._M_prev;
396 __x._M_node._M_data._M_prev->_M_next = &__x._M_node._M_data;
397 this->_M_empty_initialize();
407 }
else if (this->
empty()) {
410 this->_M_node.
swap(__x._M_node);
411 _STLP_STD::swap(this->_M_node.
_M_data._M_prev->_M_next, __x._M_node._M_data._M_prev->_M_next);
412 _STLP_STD::swap(this->_M_node.
_M_data._M_next->_M_prev, __x._M_node._M_data._M_next->_M_prev);
415#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
416 void _M_swap_workaround(_Self& __x) {
swap(__x); }
419#if !defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
428 __tmp->_M_next =
__n;
429 __tmp->_M_prev = __p;
430 __p->_M_next = __tmp;
431 __n->_M_prev = __tmp;
436#if defined (_STLP_MEMBER_TEMPLATES)
437 template <
class _InputIterator>
438 void _M_insert(
iterator __pos, _InputIterator __first, _InputIterator
__last) {
440 _M_insert_dispatch(__pos, __first,
__last, _Integral());
444 template<
class _Integer>
445 void _M_insert_dispatch(
iterator __pos, _Integer
__n, _Integer __x,
449 template <
class _InputIter>
450 void _M_insert_dispatch(
iterator __pos,
451 _InputIter __first, _InputIter
__last,
455 for (; __first !=
__last; ++__first)
461 for (; __first !=
__last; ++__first)
466#if defined (_STLP_MEMBER_TEMPLATES)
467 template <
class _InputIterator>
470 _M_splice_insert_dispatch(__pos, __first,
__last, _Integral());
475 template<
class _Integer>
476 void _M_splice_insert_dispatch(
iterator __pos, _Integer
__n, _Integer __x,
480 template <
class _InputIter>
481 void _M_splice_insert_dispatch(
iterator __pos,
482 _InputIter __first, _InputIter
__last,
511#if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
519 _Node_base* __next_node = __pos._M_node->_M_next;
520 _Node_base* __prev_node = __pos._M_node->_M_prev;
522 __prev_node->_M_next = __next_node;
523 __next_node->_M_prev = __prev_node;
524 _STLP_STD::_Destroy(&
__n->_M_data);
525 this->_M_node.deallocate(
__n, 1);
535#if !defined (_STLP_DONT_SUP_DFLT_PARAM)
557 void _M_fill_assign(size_type
__n, const_reference
__val);
559#if defined (_STLP_MEMBER_TEMPLATES)
560 template <
class _InputIterator>
561 void assign(_InputIterator __first, _InputIterator
__last) {
563 _M_assign_dispatch(__first,
__last, _Integral());
566 template <
class _Integer>
567 void _M_assign_dispatch(_Integer
__n, _Integer
__val,
572 template <
class _InputIterator>
573 void _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
579 for ( ; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
580 *__first1 = *__first2;
581 if (__first2 == __last2)
582 erase(__first1, __last1);
584 insert(__last1, __first2, __last2);
590 for ( ; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
591 *__first1 = *__first2;
592 if (__first2 == __last2)
593 erase(__first1, __last1);
595 insert(__last1, __first2, __last2);
613 if (__pos == __i || __pos == __j)
return;
637 while (__first !=
__last) {
655 _STLP_STD::swap(__tmp->_M_next, __tmp->_M_prev);
656 __tmp = __tmp->_M_prev;
657 }
while (__tmp != __p);
663#if defined (_STLP_MEMBER_TEMPLATES)
664 template <
class _Predicate>
667 template <
class _BinaryPredicate>
668 void unique(_BinaryPredicate __binary_pred)
671 template <
class _StrictWeakOrdering>
672 void merge(_Self& __x,
673 _StrictWeakOrdering __comp) {
677 template <
class _StrictWeakOrdering>
678 void sort(_StrictWeakOrdering __comp)
690#if !defined (_STLP_LINK_TIME_INSTANTIATION)
694#if defined (_STLP_USE_PTR_SPECIALIZATIONS)
698#if defined (_STLP_DEBUG)
704template <
class _Tp,
class _Alloc>
708 const_iterator __end1 = __x.
end();
709 const_iterator __end2 = __y.
end();
711 const_iterator __i1 = __x.
begin();
712 const_iterator __i2 = __y.
begin();
713 while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) {
717 return __i1 == __end1 && __i2 == __end2;
720#define _STLP_EQUAL_OPERATOR_SPECIALIZED
721#define _STLP_TEMPLATE_HEADER template <class _Tp, class _Alloc>
722#define _STLP_TEMPLATE_CONTAINER list<_Tp, _Alloc>
724#undef _STLP_TEMPLATE_CONTAINER
725#undef _STLP_TEMPLATE_HEADER
726#undef _STLP_EQUAL_OPERATOR_SPECIALIZED
728#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_NO_MOVE_SEMANTIC)
729template <
class _Tp,
class _Alloc>
#define bidirectional_iterator_tag
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
_STLP_INLINE_LOOP _InputIter __last
_STLP_INLINE_LOOP _InputIter _Predicate __pred
_STLP_INLINE_LOOP _ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
_STLP_INLINE_LOOP _InputIter const _Tp & __val
#define _STLP_CONVERT_ALLOCATOR(__a, _Tp)
#define _STLP_FORCE_ALLOCATORS(a, y)
void _Copy_Construct(_Tp *__p, const _Tp &__val)
#define _STLP_DEFAULT_CONSTRUCTED(_TTp)
#define _STLP_ASSERT(expr)
void _S_sort(list< _Tp, _Alloc > &__that, _StrictWeakOrdering __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE void _S_remove_if(list< _Tp, _Alloc > &__that, _Predicate __pred)
void _S_merge(list< _Tp, _Alloc > &__that, list< _Tp, _Alloc > &__x, _StrictWeakOrdering __comp)
void _S_unique(list< _Tp, _Alloc > &__that, _BinaryPredicate __binary_pred)
void _S_sort(list< _Tp, _Alloc > &__that, _StrictWeakOrdering __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE void _S_remove_if(list< _Tp, _Alloc > &__that, _Predicate __pred)
void _S_merge(list< _Tp, _Alloc > &__that, list< _Tp, _Alloc > &__x, _StrictWeakOrdering __comp)
void _S_unique(list< _Tp, _Alloc > &__that, _BinaryPredicate __binary_pred)
_List_global< bool > _List_global_inst
#define _STLP_DEFINE_ARROW_OPERATOR
void get(int argc, const char *argv[])
void _M_empty_initialize()
_Alloc_traits< _Node, _Alloc >::allocator_type _Node_allocator_type
_List_base(const allocator_type &__a)
_List_base(__move_source< _Self > src)
allocator_type get_allocator() const
_List_node_base _Node_base
static void _STLP_CALL _Transfer(_Node_base *__pos, _Node_base *__first, _Node_base *__last)
_Tp * allocate(size_type __n, size_type &__allocated_n)
void _M_swap_aux(_Self &__x)
iterator erase(iterator __first, iterator __last)
const_reference back() const
const_reference front() const
list< _Tp, _Alloc > _Self
list(size_type __n, const_reference __val=_STLP_DEFAULT_CONSTRUCTED(value_type), const allocator_type &__a=allocator_type())
void push_back(const_reference __x)
void splice(iterator __pos, _Self &__x)
void insert(iterator __pos, size_type __n, const_reference __x)
const value_type * const_pointer
_Node_base * _M_create_node(const_reference __x=value_type())
_STLP_PRIV _List_node< _Tp > _Node
void assign(const_iterator __first2, const_iterator __last2)
iterator erase(iterator __pos)
allocator_type get_allocator() const
void _M_insert(iterator __pos, const_iterator __first, const_iterator __last)
void remove(const_reference __val)
list(const value_type *__first, const value_type *__last, const allocator_type &__a=allocator_type())
void assign(const value_type *__first2, const value_type *__last2)
_Base::allocator_type allocator_type
void _M_insert(iterator __pos, const value_type *__first, const value_type *__last)
const_iterator end() const
const value_type & const_reference
void _M_fill_insert(iterator __pos, size_type __n, const_reference __x)
_STLP_PRIV _List_node_base _Node_base
_STLP_PRIV _List_iterator< _Tp, _Const_traits< _Tp > > const_iterator
list(__move_source< _Self > src)
ptrdiff_t difference_type
const_reverse_iterator rbegin() const
void splice(iterator __pos, _Self &__x, iterator __i)
size_type max_size() const
_STLP_PRIV _List_base< _Tp, _Alloc > _Base
const_iterator begin() const
const_reverse_iterator rend() const
list(const_iterator __first, const_iterator __last, const allocator_type &__a=allocator_type())
void insert(iterator __pos, const value_type *__first, const value_type *__last)
reverse_iterator rbegin()
void push_front(const_reference __x)
void insert(iterator __pos, const_iterator __first, const_iterator __last)
void assign(size_type __n, const_reference __val)
void resize(size_type __new_size, const_reference __x=value_type())
iterator insert(iterator __pos, const_reference __x=value_type())
void splice(iterator __pos, _Self &__x, iterator __first, iterator __last)
list(const allocator_type &__a=allocator_type())
void _M_fill_assign(size_type __n, const_reference __val)
static const WCHAR empty[]
__kernel_ptrdiff_t ptrdiff_t
#define _STLP_UNWIND(action)
#define _STLP_INLINE_LOOP
#define __TRIVIAL_STUFF(__type)
#define _STLP_MOVE_TO_STD_NAMESPACE
#define _STLP_DECLARE_BIDIRECTIONAL_REVERSE_ITERATORS
#define __STATIC_CAST(__x, __y)
#define _STLP_ALLOCATOR_TYPE_DFL
#define __CONST_CAST(__x, __y)
#define _STLP_EXPORT_TEMPLATE_CLASS
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
_List_node_base * _M_node
bidirectional_iterator_tag iterator_category
_List_iterator_base(_List_node_base *__x)
ptrdiff_t difference_type
_List_iterator< _Tp, _ConstTraits > const_iterator
_Traits::_NonConstTraits _NonConstTraits
bool operator!=(const_iterator __y) const
_STLP_DEFINE_ARROW_OPERATOR _Self & operator++()
_Traits::reference reference
reference operator*() const
bidirectional_iterator_tag iterator_category
_Traits::_ConstTraits _ConstTraits
_List_iterator< _Tp, _NonConstTraits > iterator
bool operator==(const_iterator __y) const
_List_iterator(const iterator &__x)
ptrdiff_t difference_type
_List_iterator(_List_node_base *__x)
_List_iterator< _Tp, _Traits > _Self
_List_node_base * _M_prev
_List_node_base * _M_next
__bool2type< pod >::_Ret is_POD_type
__bool2type< trivial_destructor >::_Ret has_trivial_destructor
__bool2type< trivial_constructor >::_Ret has_trivial_default_constructor
__bool2type< trivial_copy >::_Ret has_trivial_copy_constructor
__bool2type< trivial_assign >::_Ret has_trivial_assignment_operator
bool operator==(const TKeyDef &t1, const TKeyDef &t2)