30#ifndef _STLP_INTERNAL_DBG_LIST_H
31#define _STLP_INTERNAL_DBG_LIST_H
33#ifndef _STLP_INTERNAL_ALGO_H
37#ifndef _STLP_DBG_ITERATOR_H
41#define _STLP_NON_DBG_LIST _STLP_PRIV _STLP_NON_DBG_NAME(list) <_Tp, _Alloc>
45#if defined (_STLP_DEBUG_USE_DISTINCT_VALUE_TYPE_HELPERS)
46template <
class _Tp,
class _Alloc>
50template <
class _Tp,
class _Alloc>
56template <
class _Tp, _STLP_DFL_TMPL_PARAM(_Alloc, allocator<_Tp>) >
62#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
92 _M_non_dbg_impl(__a), _M_iter_list(&_M_non_dbg_impl) {}
94#if !defined(_STLP_DONT_SUP_DFLT_PARAM)
100 : _M_non_dbg_impl(
__n, __x, __a), _M_iter_list(&_M_non_dbg_impl) {}
102#if defined(_STLP_DONT_SUP_DFLT_PARAM)
104 : _M_non_dbg_impl(
__n), _M_iter_list(&_M_non_dbg_impl) {}
107#if !defined (_STLP_NO_MOVE_SEMANTIC)
110 _M_iter_list(&_M_non_dbg_impl) {
111# if defined (_STLP_NO_EXTENSIONS) || (_STLP_DEBUG_LEVEL == _STLP_STANDARD_DBG_LEVEL)
112 src.get()._M_iter_list._Invalidate_all();
114 src.get()._M_iter_list._Set_owner(_M_iter_list);
119#if defined (_STLP_MEMBER_TEMPLATES)
120 template <
class _InputIterator>
121 list(_InputIterator __first, _InputIterator
__last,
123 : _ConstructCheck(__first,
__last),
125 _M_iter_list(&_M_non_dbg_impl) {}
126# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
127 template <
class _InputIterator>
128 list(_InputIterator __first, _InputIterator
__last)
129 : _ConstructCheck(__first,
__last),
131 _M_iter_list(&_M_non_dbg_impl) {}
138 _M_non_dbg_impl(__first,
__last, __a),
139 _M_iter_list(&_M_non_dbg_impl) {}
143 _M_non_dbg_impl(__first._M_iterator,
__last._M_iterator, __a),
144 _M_iter_list(&_M_non_dbg_impl) {}
150 _M_non_dbg_impl(__x._M_non_dbg_impl) , _M_iter_list(&_M_non_dbg_impl) {}
172 const_reverse_iterator
rbegin()
const {
return const_reverse_iterator(
end()); }
173 const_reverse_iterator
rend()
const {
return const_reverse_iterator(
begin()); }
177 bool empty()
const {
return _M_non_dbg_impl.empty(); }
201#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
202 void _M_swap_workaround(_Self& __x) {
swap(__x); }
205#if !defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
211 return iterator(&_M_iter_list,_M_non_dbg_impl.insert(__pos._M_iterator, __x) );
214#if defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
218#if defined (_STLP_MEMBER_TEMPLATES)
219 template <
class _InputIterator>
223 _M_non_dbg_impl.insert(__pos._M_iterator,
228#if !defined (_STLP_MEMBER_TEMPLATES)
232 _M_non_dbg_impl.insert(__pos._M_iterator, __first,
__last);
236#if !defined (_STLP_MEMBER_TEMPLATES) || !defined (_STLP_NO_METHOD_SPECIALIZATION)
241# if (_STLP_DEBUG_LEVEL == _STLP_STANDARD_DBG_LEVEL)
242 _STLP_STD_DEBUG_CHECK(__check_if_not_owner(&_M_iter_list, __first))
244 _M_non_dbg_impl.insert(__pos._M_iterator, __first._M_iterator,
__last._M_iterator);
250# if (_STLP_DEBUG_LEVEL == _STLP_STANDARD_DBG_LEVEL)
251 _STLP_STD_DEBUG_CHECK(__check_if_not_owner(&_M_iter_list, __first))
253 _M_non_dbg_impl.insert(__pos._M_iterator, __first._M_iterator,
__last._M_iterator);
259 _M_non_dbg_impl.insert(__pos._M_iterator,
__n, __x);
266 _M_non_dbg_impl.pop_back();
273 _M_non_dbg_impl.pop_front();
280 return iterator(&_M_iter_list,_M_non_dbg_impl.erase(__pos._M_iterator));
285 return iterator (&_M_iter_list, _M_non_dbg_impl.erase(__first._M_iterator,
__last._M_iterator));
288#if !defined(_STLP_DONT_SUP_DFLT_PARAM)
295 for ( ; __i != _M_non_dbg_impl.end() && __len < __new_size; ++__i, ++__len);
297 if (__len == __new_size)
300 _M_non_dbg_impl.insert(_M_non_dbg_impl.end(), __new_size - __len, __x);
303#if defined(_STLP_DONT_SUP_DFLT_PARAM)
307#if defined (_STLP_MEMBER_TEMPLATES)
308 template <
class _InputIterator>
309 void assign(_InputIterator __first, _InputIterator
__last) {
317 _M_non_dbg_impl.assign(__first,
__last);
323 _M_non_dbg_impl.assign(__first._M_iterator,
__last._M_iterator);
329 _M_non_dbg_impl.assign(__first._M_iterator,
__last._M_iterator);
341 while (__first !=
__last) {
344 if (__x == *__first) {
346 _M_non_dbg_impl.erase(__first);
354 _M_non_dbg_impl.clear();
361#if (_STLP_DEBUG_LEVEL != _STLP_STANDARD_DBG_LEVEL)
375 _M_non_dbg_impl.splice(__pos._M_iterator, __x.
_M_non_dbg_impl, __i._M_iterator);
376#if (_STLP_DEBUG_LEVEL != _STLP_STANDARD_DBG_LEVEL)
378 _STLP_PRIV __change_ite_owner(__i, &_M_iter_list);
389#if (_STLP_DEBUG_LEVEL != _STLP_STANDARD_DBG_LEVEL)
396 _M_non_dbg_impl.splice(__pos._M_iterator, __x.
_M_non_dbg_impl, __first._M_iterator,
__last._M_iterator);
400#if !defined (_STLP_NO_EXTENSIONS)
413 _M_non_dbg_impl.reverse();
417 if (__first ==
__last)
return;
419 while (++__next !=
__last) {
420 if (*__first == *__next) {
422 _M_non_dbg_impl.erase(__next);
430 _M_non_dbg_impl.sort();
433#if defined (_STLP_MEMBER_TEMPLATES)
434 template <
class _Predicate>
436 _Base_iterator __first = _M_non_dbg_impl.begin(),
__last = _M_non_dbg_impl.end();
437 while (__first !=
__last) {
438 _Base_iterator __next = __first;
441 _Invalidate_iterator(
iterator(&_M_iter_list, __first));
442 _M_non_dbg_impl.erase(__first);
448 template <
class _BinaryPredicate>
449 void unique(_BinaryPredicate __binary_pred) {
450 _Base_iterator __first = _M_non_dbg_impl.begin(),
__last = _M_non_dbg_impl.end();
451 if (__first ==
__last)
return;
452 _Base_iterator __next = __first;
453 while (++__next !=
__last) {
454 if (__binary_pred(*__first, *__next)) {
456 _M_non_dbg_impl.erase(__next);
464 template <
class _StrictWeakOrdering>
465 void merge(_Self& __x, _StrictWeakOrdering __comp) {
466#if !defined (_STLP_NO_EXTENSIONS)
467 _STLP_DEBUG_CHECK(_STLP_STD::is_sorted(_M_non_dbg_impl.begin(), _M_non_dbg_impl.end(), __comp))
468 _STLP_DEBUG_CHECK(_STLP_STD::is_sorted(__x.begin()._M_iterator, __x.end()._M_iterator, __comp))
470 _M_non_dbg_impl.merge(__x._M_non_dbg_impl, __comp);
472 __x._M_iter_list._Set_owner(_M_iter_list);
475 __x._Invalidate_iterators(__x.begin(), __x.end());
479 template <
class _StrictWeakOrdering>
480 void sort(_StrictWeakOrdering __comp) {
481 _M_non_dbg_impl.sort(__comp);
489#undef _STLP_NON_DBG_LIST
#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_DEFAULT_CONSTRUCTED(_TTp)
#define _STLP_DEBUG_CHECK(expr)
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
_STLP_MOVE_TO_PRIV_NAMESPACE const _InputIterator const input_iterator_tag &_InputIterator __it(__first)
void get(int argc, const char *argv[])
void insert(iterator __pos, iterator __first, iterator __last)
void resize(size_type __new_size, const _Tp &__x=_Tp())
iterator erase(iterator __first, iterator __last)
const_reference back() const
const_reference front() const
list< _Tp, _Alloc > _Self
list(size_type __n, const _Tp &__x=_Tp(), const allocator_type &__a=allocator_type())
void push_back(const_reference __x)
void splice(iterator __pos, _Self &__x)
void assign(const _Tp *__first, const _Tp *__last)
_STLP_PRIV __construct_checker< _STLP_NON_DBG_LIST > _ConstructCheck
iterator insert(iterator __pos, const _Tp &__x=_Tp())
void assign(iterator __first, iterator __last)
iterator erase(iterator __pos)
_STLP_PRIV _DBG_iter< _Base, _STLP_PRIV _DbgTraits< _Nonconst_traits< value_type > > > iterator
allocator_type get_allocator() const
void remove(const _Tp &__x)
void assign(const_iterator __first, const_iterator __last)
list(const value_type *__first, const value_type *__last, const allocator_type &__a=allocator_type())
_Base::allocator_type allocator_type
void insert(iterator __pos, size_type __n, const _Tp &__x)
const_iterator end() const
const value_type & const_reference
_STLP_PRIV __owned_list _M_iter_list
_STLP_PRIV _DBG_iter< _Base, _STLP_PRIV _DbgTraits< _Const_traits< value_type > > > const_iterator
_Base::iterator _Base_iterator
void _Invalidate_iterator(const iterator &__it)
_STLP_PRIV _List_iterator< _Tp, _Const_traits< _Tp > > const_iterator
list(__move_source< _Self > src)
void insert(iterator __pos, const _Tp *__first, const _Tp *__last)
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
void assign(size_type __n, const _Tp &__val)
const_iterator begin() const
const_reverse_iterator rend() const
list(const_iterator __first, const_iterator __last, const allocator_type &__a=allocator_type())
reverse_iterator rbegin()
void _Invalidate_iterators(const iterator &__first, const iterator &__last)
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())
void splice(iterator __pos, _Self &__x, iterator __first, iterator __last)
_Self & operator=(const _Self &__x)
list(const allocator_type &__a=allocator_type())
_Iterator _Non_Dbg_iter(_Iterator __it)
bool _Dereferenceable(const _Iterator &__it)
#define _STLP_NON_DBG_LIST
static const WCHAR empty[]
#define _STLP_DECLARE_BIDIRECTIONAL_REVERSE_ITERATORS
#define __IMPORT_CONTAINER_TYPEDEFS(_Super)
#define _STLP_ALLOCATOR_TYPE_DFL
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE