ReactOS  0.4.12-dev-918-g6c6e7b8
_list.h
Go to the documentation of this file.
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_LIST_IMPL_H
31 #define _STLP_INTERNAL_LIST_IMPL_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_CONSTRUCT_H
46 # include <stl/_construct.h>
47 #endif
48 
49 #ifndef _STLP_INTERNAL_FUNCTION_BASE_H
50 # include <stl/_function_base.h>
51 #endif
52 
54 
56 
60 };
61 
62 template <class _Dummy>
63 class _List_global {
64 public:
66  static void _STLP_CALL _Transfer(_Node_base* __pos,
67  _Node_base* __first, _Node_base* __last);
68 };
69 
70 #if defined (_STLP_USE_TEMPLATE_EXPORT)
72 #endif
74 
75 template <class _Tp>
76 class _List_node : public _List_node_base {
77 public:
78  _Tp _M_data;
80 };
81 
83  typedef size_t size_type;
86 
88 
90 
91  void _M_incr() { _M_node = _M_node->_M_next; }
92  void _M_decr() { _M_node = _M_node->_M_prev; }
93 };
94 
95 
96 template<class _Tp, class _Traits>
98  typedef _Tp value_type;
99  typedef typename _Traits::pointer pointer;
100  typedef typename _Traits::reference reference;
101 
103  typedef typename _Traits::_NonConstTraits _NonConstTraits;
105  typedef typename _Traits::_ConstTraits _ConstTraits;
107 
110  typedef size_t size_type;
112 
115  //copy constructor for iterator and constructor from iterator for const_iterator
117 
118  reference operator*() const { return __STATIC_CAST(_Node*, this->_M_node)->_M_data; }
119 
121 
122  _Self& operator++() {
123  this->_M_incr();
124  return *this;
125  }
126  _Self operator++(int) {
127  _Self __tmp = *this;
128  this->_M_incr();
129  return __tmp;
130  }
132  this->_M_decr();
133  return *this;
134  }
135  _Self operator--(int) {
136  _Self __tmp = *this;
137  this->_M_decr();
138  return __tmp;
139  }
140  bool operator==(const_iterator __y ) const {
141  return this->_M_node == __y._M_node;
142  }
143  bool operator!=(const_iterator __y ) const {
144  return this->_M_node != __y._M_node;
145  }
146 };
147 
148 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
150 template <class _Tp, class _Traits>
151 struct __type_traits<_STLP_PRIV _List_iterator<_Tp, _Traits> > {
156  typedef __false_type is_POD_type;
157 };
159 #endif
160 
161 #if defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES)
163 template <class _Tp, class _Traits>
164 inline _Tp* value_type(const _STLP_PRIV _List_iterator<_Tp, _Traits>&) { return 0; }
165 inline bidirectional_iterator_tag iterator_category(const _STLP_PRIV _List_iterator_base&) { return bidirectional_iterator_tag();}
166 inline ptrdiff_t* distance_type(const _STLP_PRIV _List_iterator_base&) { return 0; }
168 #endif
169 
170 // Base class that encapsulates details of allocators and helps
171 // to simplify EH
172 
173 template <class _Tp, class _Alloc>
174 class _List_base {
175 protected:
178  typedef _List_node<_Tp> _Node;
179  typedef _List_base<_Tp, _Alloc> _Self;
181 public:
184 
186  { return _STLP_CONVERT_ALLOCATOR((const _Node_allocator_type&)_M_node, _Tp); }
187 
189  { _M_empty_initialize(); }
190 
191 #if !defined (_STLP_NO_MOVE_SEMANTIC)
194  if (src.get().empty())
195  //We force this to empty.
197  else {
198  src.get()._M_empty_initialize();
200  }
201  }
202 #endif
203 
205  { clear(); }
206 
207  void clear();
208  bool empty() const { return _M_node._M_data._M_next == &_M_node._M_data; }
209 
213  }
214 
215 public:
217 };
218 
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)
223 #else
225 #endif
226 
227 template <class _Tp, _STLP_DFL_TMPL_PARAM(_Alloc, allocator<_Tp>) >
228 class list;
229 
230 #if !defined (list)
232 #endif
233 
234 // helper functions to reduce code duplication
235 template <class _Tp, class _Alloc, class _Predicate>
236 void _S_remove_if(list<_Tp, _Alloc>& __that, _Predicate __pred);
237 
238 template <class _Tp, class _Alloc, class _BinaryPredicate>
239 void _S_unique(list<_Tp, _Alloc>& __that, _BinaryPredicate __binary_pred);
240 
241 template <class _Tp, class _Alloc, class _StrictWeakOrdering>
242 void _S_merge(list<_Tp, _Alloc>& __that, list<_Tp, _Alloc>& __x,
243  _StrictWeakOrdering __comp);
244 
245 template <class _Tp, class _Alloc, class _StrictWeakOrdering>
246 void _S_sort(list<_Tp, _Alloc>& __that, _StrictWeakOrdering __comp);
247 
248 #if !defined (list)
250 #endif
251 
252 template <class _Tp, class _Alloc>
253 class list : public _STLP_PRIV _List_base<_Tp, _Alloc>
254 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (list)
255  , public __stlport_class<list<_Tp, _Alloc> >
256 #endif
257 {
262 public:
263  typedef _Tp value_type;
264  typedef value_type* pointer;
265  typedef const value_type* const_pointer;
267  typedef const value_type& const_reference;
268  typedef size_t size_type;
273 
274 public:
278 
279 protected:
280 #if !defined (_STLP_DONT_SUP_DFLT_PARAM)
282 #else
284 #endif
285  _Node* __p = this->_M_node.allocate(1);
286  _STLP_TRY {
287  _Copy_Construct(&__p->_M_data, __x);
288  }
289  _STLP_UNWIND(this->_M_node.deallocate(__p, 1))
290  return __p;
291  }
292 
293 #if defined (_STLP_DONT_SUP_DFLT_PARAM)
295  _Node* __p = this->_M_node.allocate(1);
296  _STLP_TRY {
297  _STLP_STD::_Construct(&__p->_M_data);
298  }
299  _STLP_UNWIND(this->_M_node.deallocate(__p, 1))
300  return __p;
301  }
302 #endif
303 
304 public:
305 #if !defined (_STLP_DONT_SUP_DFLT_PARAM)
307  const allocator_type& __a = allocator_type())
308 #else
309  explicit list(size_type __n)
311  { this->insert(begin(), __n, _STLP_DEFAULT_CONSTRUCTED(value_type)); }
314  { this->insert(begin(), __n, __val); }
316 #endif /*_STLP_DONT_SUP_DFLT_PARAM*/
318  { this->insert(begin(), __n, __val); }
319 
320 #if defined (_STLP_MEMBER_TEMPLATES)
321  // We don't need any dispatching tricks here, because insert does all of
322  // that anyway.
323  template <class _InputIterator>
324  list(_InputIterator __first, _InputIterator __last,
326  : _STLP_PRIV _List_base<_Tp, _Alloc>(__a)
327  { _M_insert(begin(), __first, __last); }
328 
329 # if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
330  template <class _InputIterator>
331  list(_InputIterator __first, _InputIterator __last)
333  { _M_insert(begin(), __first, __last); }
334 # endif
335 #else /* _STLP_MEMBER_TEMPLATES */
336  list(const value_type* __first, const value_type* __last,
337  const allocator_type& __a = allocator_type())
338  : _STLP_PRIV _List_base<_Tp, _Alloc>(__a)
339  { _M_insert(begin(), __first, __last); }
341  const allocator_type& __a = allocator_type())
342  : _STLP_PRIV _List_base<_Tp, _Alloc>(__a)
343  { _M_insert(begin(), __first, __last); }
344 #endif /* _STLP_MEMBER_TEMPLATES */
345 
346 #if !defined (_STLP_DONT_SUP_DFLT_PARAM)
347  explicit list(const allocator_type& __a = allocator_type())
348 #else
349  list()
351  list(const allocator_type& __a)
352 #endif
354 
355  list(const _Self& __x) : _STLP_PRIV _List_base<_Tp, _Alloc>(__x.get_allocator())
356  { _M_insert(begin(), __x.begin(), __x.end()); }
357 
358 #if !defined (_STLP_NO_MOVE_SEMANTIC)
361 #endif
362 
363  ~list() {}
364 
365  _Self& operator = (const _Self& __x);
366 
367  iterator begin() { return iterator(this->_M_node._M_data._M_next); }
368  const_iterator begin() const { return const_iterator(this->_M_node._M_data._M_next); }
369 
370  iterator end() { return iterator(&this->_M_node._M_data); }
371  const_iterator end() const { return const_iterator(__CONST_CAST(_Node_base*, &this->_M_node._M_data)); }
372 
374  const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
375 
377  const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
378 
379  size_type size() const {
380  size_type __result = _STLP_STD::distance(begin(), end());
381  return __result;
382  }
383  size_type max_size() const { return size_type(-1); }
384 
385  reference front() { return *begin(); }
386  const_reference front() const { return *begin(); }
387  reference back() { return *(--end()); }
388  const_reference back() const { return *(--end()); }
389 
390 private:
391  void _M_swap_aux(_Self& __x) {
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();
398  }
399 
400 public:
401  void swap(_Self& __x) {
402  if (__x.empty()) {
403  if (this->empty()) {
404  return;
405  }
406  this->_M_swap_aux(__x);
407  } else if (this->empty()) {
408  __x._M_swap_aux(*this);
409  } else {
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);
413  }
414  }
415 #if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
416  void _M_swap_workaround(_Self& __x) { swap(__x); }
417 #endif
418 
419 #if !defined(_STLP_DONT_SUP_DFLT_PARAM) && !defined(_STLP_NO_ANACHRONISMS)
421 #else
423 #endif
424  {
425  _Node_base* __tmp = _M_create_node(__x);
426  _Node_base* __n = __pos._M_node;
427  _Node_base* __p = __n->_M_prev;
428  __tmp->_M_next = __n;
429  __tmp->_M_prev = __p;
430  __p->_M_next = __tmp;
431  __n->_M_prev = __tmp;
432  return iterator(__tmp);
433  }
434 
435 private:
436 #if defined (_STLP_MEMBER_TEMPLATES)
437  template <class _InputIterator>
438  void _M_insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
439  typedef typename _IsIntegral<_InputIterator>::_Ret _Integral;
440  _M_insert_dispatch(__pos, __first, __last, _Integral());
441  }
442 
443  // Check whether it's an integral type. If so, it's not an iterator.
444  template<class _Integer>
445  void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
446  const __true_type& /*_IsIntegral*/) {
447  _M_fill_insert(__pos, __n, __x);
448  }
449  template <class _InputIter>
450  void _M_insert_dispatch(iterator __pos,
451  _InputIter __first, _InputIter __last,
452  const __false_type& /*_IsIntegral*/) {
453 #else /* _STLP_MEMBER_TEMPLATES */
454  void _M_insert(iterator __pos, const value_type* __first, const value_type* __last) {
455  for (; __first != __last; ++__first)
456  insert(__pos, *__first);
457  }
459 #endif /* _STLP_MEMBER_TEMPLATES */
460  //We use a temporary list to avoid the auto reference troubles (infinite loop)
461  for (; __first != __last; ++__first)
462  insert(__pos, *__first);
463  }
464 
465 public:
466 #if defined (_STLP_MEMBER_TEMPLATES)
467  template <class _InputIterator>
468  void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
469  typedef typename _IsIntegral<_InputIterator>::_Ret _Integral;
470  _M_splice_insert_dispatch(__pos, __first, __last, _Integral());
471  }
472 
473 private:
474  // Check whether it's an integral type. If so, it's not an iterator.
475  template<class _Integer>
476  void _M_splice_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
477  const __true_type& /*_IsIntegral*/) {
478  _M_fill_insert(__pos, __n, __x);
479  }
480  template <class _InputIter>
481  void _M_splice_insert_dispatch(iterator __pos,
482  _InputIter __first, _InputIter __last,
483  const __false_type& /*_IsIntegral*/) {
484 #else /* _STLP_MEMBER_TEMPLATES */
485  void insert(iterator __pos, const value_type* __first, const value_type* __last) {
486  _Self __tmp(__first, __last, this->get_allocator());
487  _STLP_ASSERT(__tmp.get_allocator() == this->get_allocator())
488  splice(__pos, __tmp);
489  }
491 #endif /* _STLP_MEMBER_TEMPLATES */
492  //We use a temporary list to avoid the auto reference troubles (infinite loop)
493  _Self __tmp(__first, __last, this->get_allocator());
494  splice(__pos, __tmp);
495  }
496 
497 public:
499  { _M_fill_insert(__pos, __n, __x); }
500 
501 private:
503  for ( ; __n > 0; --__n)
504  insert(__pos, __x);
505  }
506 
507 public:
508  void push_front(const_reference __x) { insert(begin(), __x); }
509  void push_back (const_reference __x) { insert(end(), __x); }
510 
511 #if defined (_STLP_DONT_SUP_DFLT_PARAM) && !defined (_STLP_NO_ANACHRONISMS)
512  iterator insert(iterator __pos)
513  { return insert(__pos, _STLP_DEFAULT_CONSTRUCTED(value_type)); }
514  void push_front() {insert(begin());}
515  void push_back() {insert(end());}
516 # endif /*_STLP_DONT_SUP_DFLT_PARAM && !_STLP_NO_ANACHRONISMS*/
517 
519  _Node_base* __next_node = __pos._M_node->_M_next;
520  _Node_base* __prev_node = __pos._M_node->_M_prev;
521  _Node* __n = __STATIC_CAST(_Node*, __pos._M_node);
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);
526  return iterator(__next_node);
527  }
528 
530  while (__first != __last)
531  erase(__first++);
532  return __last;
533  }
534 
535 #if !defined (_STLP_DONT_SUP_DFLT_PARAM)
536  void resize(size_type __new_size, const_reference __x = value_type());
537 #else
538  void resize(size_type __new_size, const_reference __x);
539  void resize(size_type __new_size)
540  { this->resize(__new_size, _STLP_DEFAULT_CONSTRUCTED(value_type)); }
541 #endif
543  void pop_front() { erase(begin()); }
544  void pop_back() {
545  iterator __tmp = end();
546  erase(--__tmp);
547  }
548 
549 public:
550  // assign(), a generalized assignment member function. Two
551  // versions: one that takes a count, and one that takes a range.
552  // The range version is a member template, so we dispatch on whether
553  // or not the type is an integer.
554 
556 
558 
559 #if defined (_STLP_MEMBER_TEMPLATES)
560  template <class _InputIterator>
561  void assign(_InputIterator __first, _InputIterator __last) {
562  typedef typename _IsIntegral<_InputIterator>::_Ret _Integral;
563  _M_assign_dispatch(__first, __last, _Integral());
564  }
565 
566  template <class _Integer>
567  void _M_assign_dispatch(_Integer __n, _Integer __val,
568  const __true_type& /*_IsIntegral*/) {
570  }
571 
572  template <class _InputIterator>
573  void _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
574  const __false_type& /*_IsIntegral*/) {
575 #else
576  void assign(const value_type *__first2, const value_type *__last2) {
577  iterator __first1 = begin();
578  iterator __last1 = end();
579  for ( ; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
580  *__first1 = *__first2;
581  if (__first2 == __last2)
582  erase(__first1, __last1);
583  else
584  insert(__last1, __first2, __last2);
585  }
586  void assign(const_iterator __first2, const_iterator __last2) {
587 #endif /* _STLP_MEMBER_TEMPLATES */
588  iterator __first1 = begin();
589  iterator __last1 = end();
590  for ( ; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
591  *__first1 = *__first2;
592  if (__first2 == __last2)
593  erase(__first1, __last1);
594  else
595  insert(__last1, __first2, __last2);
596  }
597 
598 public:
599  void splice(iterator __pos, _Self& __x) {
600  if (!__x.empty()) {
601  if (this->get_allocator() == __x.get_allocator()) {
602  _STLP_PRIV _List_global_inst::_Transfer(__pos._M_node, __x.begin()._M_node, __x.end()._M_node);
603  }
604  else {
605  insert(__pos, __x.begin(), __x.end());
606  __x.clear();
607  }
608  }
609  }
610  void splice(iterator __pos, _Self& __x, iterator __i) {
611  iterator __j = __i;
612  ++__j;
613  if (__pos == __i || __pos == __j) return;
614  if (this->get_allocator() == __x.get_allocator()) {
615  _STLP_PRIV _List_global_inst::_Transfer(__pos._M_node, __i._M_node, __j._M_node);
616  }
617  else {
618  insert(__pos, *__i);
619  __x.erase(__i);
620  }
621  }
622  void splice(iterator __pos, _Self& __x, iterator __first, iterator __last) {
623  if (__first != __last) {
624  if (this->get_allocator() == __x.get_allocator()) {
625  _STLP_PRIV _List_global_inst::_Transfer(__pos._M_node, __first._M_node, __last._M_node);
626  }
627  else {
628  insert(__pos, __first, __last);
629  __x.erase(__first, __last);
630  }
631  }
632  }
633 
635  iterator __first = begin();
636  iterator __last = end();
637  while (__first != __last) {
638  iterator __next = __first;
639  ++__next;
640  if (__val == *__first) erase(__first);
641  __first = __next;
642  }
643  }
644 
645  void unique()
647 
648  void merge(_Self& __x)
649  { _STLP_PRIV _S_merge(*this, __x, less<value_type>()); }
650 
651  void reverse() {
652  _Node_base* __p = &this->_M_node._M_data;
653  _Node_base* __tmp = __p;
654  do {
655  _STLP_STD::swap(__tmp->_M_next, __tmp->_M_prev);
656  __tmp = __tmp->_M_prev; // Old next node is now prev.
657  } while (__tmp != __p);
658  }
659 
660  void sort()
661  { _STLP_PRIV _S_sort(*this, less<value_type>()); }
662 
663 #if defined (_STLP_MEMBER_TEMPLATES)
664  template <class _Predicate>
665  void remove_if(_Predicate __pred)
666  { _STLP_PRIV _S_remove_if(*this, __pred); }
667  template <class _BinaryPredicate>
668  void unique(_BinaryPredicate __binary_pred)
669  { _STLP_PRIV _S_unique(*this, __binary_pred); }
670 
671  template <class _StrictWeakOrdering>
672  void merge(_Self& __x,
673  _StrictWeakOrdering __comp) {
674  _STLP_PRIV _S_merge(*this, __x, __comp);
675  }
676 
677  template <class _StrictWeakOrdering>
678  void sort(_StrictWeakOrdering __comp)
679  { _STLP_PRIV _S_sort(*this, __comp); }
680 #endif /* _STLP_MEMBER_TEMPLATES */
681 };
682 
683 #if defined (list)
684 # undef list
686 #endif
687 
689 
690 #if !defined (_STLP_LINK_TIME_INSTANTIATION)
691 # include <stl/_list.c>
692 #endif
693 
694 #if defined (_STLP_USE_PTR_SPECIALIZATIONS)
695 # include <stl/pointers/_list.h>
696 #endif
697 
698 #if defined (_STLP_DEBUG)
699 # include <stl/debug/_list.h>
700 #endif
701 
703 
704 template <class _Tp, class _Alloc>
708  const_iterator __end1 = __x.end();
709  const_iterator __end2 = __y.end();
710 
711  const_iterator __i1 = __x.begin();
712  const_iterator __i2 = __y.begin();
713  while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) {
714  ++__i1;
715  ++__i2;
716  }
717  return __i1 == __end1 && __i2 == __end2;
718 }
719 
720 #define _STLP_EQUAL_OPERATOR_SPECIALIZED
721 #define _STLP_TEMPLATE_HEADER template <class _Tp, class _Alloc>
722 #define _STLP_TEMPLATE_CONTAINER list<_Tp, _Alloc>
723 #include <stl/_relops_cont.h>
724 #undef _STLP_TEMPLATE_CONTAINER
725 #undef _STLP_TEMPLATE_HEADER
726 #undef _STLP_EQUAL_OPERATOR_SPECIALIZED
727 
728 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_NO_MOVE_SEMANTIC)
729 template <class _Tp, class _Alloc>
730 struct __move_traits<list<_Tp, _Alloc> > {
731  typedef __true_type implemented;
732  typedef typename __move_traits<_Alloc>::complete complete;
733 };
734 #endif
735 
737 
738 #endif /* _STLP_INTERNAL_LIST_IMPL_H */
739 
740 // Local Variables:
741 // mode:C++
742 // End:
#define _STLP_CONVERT_ALLOCATOR(__a, _Tp)
Definition: _alloc.h:183
#define bidirectional_iterator_tag
Definition: _abbrevs.h:27
void _M_swap_aux(_Self &__x)
Definition: _list.h:391
void push_back(const_reference __x)
Definition: _list.h:509
void splice(iterator __pos, _Self &__x)
Definition: _list.h:599
void splice(iterator __pos, _Self &__x, iterator __first, iterator __last)
Definition: _list.h:622
iterator begin()
Definition: _list.h:367
void merge(_Self &__x)
Definition: _list.h:648
void splice(iterator __pos, _Self &__x, iterator __i)
Definition: _list.h:610
void insert(iterator __pos, const value_type *__first, const value_type *__last)
Definition: _list.h:485
iterator erase(iterator __pos)
Definition: _list.h:518
#define swap(a, b)
Definition: qsort.c:63
_List_base(const allocator_type &__a)
Definition: _list.h:188
list(const_iterator __first, const_iterator __last, const allocator_type &__a=allocator_type())
Definition: _list.h:340
return __n
Definition: _algo.h:75
_List_base(__move_source< _Self > src)
Definition: _list.h:192
_Tp value_type
Definition: _list.h:98
void _M_fill_assign(size_type __n, const_reference __val)
Definition: _list.c:124
bool empty() const
Definition: _list.h:208
void resize(size_type __new_size, const_reference __x=value_type())
char typename[32]
Definition: main.c:84
_Base::allocator_type allocator_type
Definition: _list.h:271
_List_iterator< _Tp, _Traits > _Self
Definition: _list.h:102
GLsizei const GLvoid * pointer
Definition: glext.h:5848
__bool2type< pod >::_Ret is_POD_type
list(const value_type *__first, const value_type *__last, const allocator_type &__a=allocator_type())
Definition: _list.h:336
#define _Alloc
Definition: _bvector.h:330
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
_Traits::reference reference
Definition: _list.h:100
allocator_type get_allocator() const
Definition: _list.h:185
_Tp _M_data
Definition: _list.h:78
void pop_back()
Definition: _list.h:544
_Self operator++(int)
Definition: _list.h:126
void _M_decr()
Definition: _list.h:92
#define reverse_iterator
Definition: _abbrevs.h:34
size_t size_type
Definition: _list.h:110
_STLP_INLINE_LOOP _InputIter _Predicate __pred
Definition: _algo.h:68
ptrdiff_t difference_type
Definition: _list.h:269
void _S_merge(list< _Tp, _Alloc > &__that, list< _Tp, _Alloc > &__x, _StrictWeakOrdering __comp)
Definition: _list.c:168
const value_type & const_reference
Definition: _list.h:267
void unique()
Definition: _list.h:645
_List_iterator_base(_List_node_base *__x)
Definition: _list.h:89
reference back()
Definition: _list.h:387
allocator_type get_allocator() const
Definition: _list.h:161
~list()
Definition: _list.h:363
_STLP_END_NAMESPACE _STLP_BEGIN_NAMESPACE _STLP_INLINE_LOOP bool _STLP_CALL operator==(const list< _Tp, _Alloc > &__x, const list< _Tp, _Alloc > &__y)
Definition: _list.h:706
_STLP_PRIV _List_node_base _Node_base
Definition: _list.h:261
_List_iterator< _Tp, _NonConstTraits > iterator
Definition: _list.h:104
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
const_reverse_iterator rbegin() const
Definition: _list.h:374
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
ptrdiff_t difference_type
Definition: _list.h:84
_List_node_base * _M_node
Definition: _list.h:87
_Value _M_data
Definition: _alloc.h:478
bool operator==(const_iterator __y) const
Definition: _list.h:140
size_type size() const
Definition: _list.h:379
const_reference back() const
Definition: _list.h:388
_Tp * allocate(size_type __n, size_type &__allocated_n)
Definition: _alloc.h:525
const_iterator begin() const
Definition: _list.h:368
iterator insert(iterator __pos, const_reference __x=value_type())
Definition: _list.h:420
void sort()
Definition: _list.h:660
list(const allocator_type &__a=allocator_type())
Definition: _list.h:347
const_reverse_iterator rend() const
Definition: _list.h:377
#define _STLP_DEFAULT_CONSTRUCTED(_TTp)
Definition: _construct.h:265
void _M_fill_insert(iterator __pos, size_type __n, const_reference __x)
Definition: _list.h:502
size_t size_type
Definition: _list.h:268
#define _STLP_UNWIND(action)
Definition: features.h:824
void reverse()
Definition: _list.h:651
void _M_incr()
Definition: _list.h:91
~_List_base()
Definition: _list.h:204
_STLP_INLINE_LOOP _InputIter __last
Definition: _algo.h:68
void _S_unique(list< _Tp, _Alloc > &__that, _BinaryPredicate __binary_pred)
Definition: _list.c:152
reference operator *() const
Definition: _list.h:118
void clear()
Definition: _list.h:352
_List_iterator()
Definition: _list.h:114
_STLP_PRIV _List_iterator< BookmarkNode, _Const_traits< BookmarkNode > > const_iterator
Definition: _list.h:276
void remove(const_reference __val)
Definition: _list.h:634
_STLP_DECLARE_BIDIRECTIONAL_REVERSE_ITERATORS
Definition: _list.h:277
void _M_insert(iterator __pos, const value_type *__first, const value_type *__last)
Definition: _list.h:454
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
void get(int argc, const char *argv[])
Definition: cmds.c:480
void _Copy_Construct(_Tp *__p, const _Tp &__val)
Definition: _construct.h:130
_Node_base * _M_create_node(const_reference __x=value_type())
Definition: _list.h:281
_List_node_base _Node_base
Definition: _list.h:65
list(const _Self &__x)
Definition: _list.h:355
#define _STLP_ALLOCATOR_TYPE_DFL
Definition: features.h:691
_STLP_INLINE_LOOP _InputIter const _Tp & __val
Definition: _algobase.h:656
_STLP_PRIV _List_base< _Tp, _Alloc > _Base
Definition: _list.h:258
void assign(const_iterator __first2, const_iterator __last2)
Definition: _list.h:586
#define _STLP_EXPORT_TEMPLATE_CLASS
Definition: features.h:987
const_reference front() const
Definition: _list.h:386
__bool2type< trivial_constructor >::_Ret has_trivial_default_constructor
list< _Tp, _Alloc > _Self
Definition: _list.h:259
static BOOL protected
Definition: protectdata.c:37
void swap(_Self &__x)
Definition: _list.h:401
_STLP_PRIV _List_node< _Tp > _Node
Definition: _list.h:260
_STLP_INLINE_LOOP _ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
Definition: _algo.h:278
#define _STLP_INLINE_LOOP
Definition: features.h:648
_List_iterator< _Tp, _ConstTraits > const_iterator
Definition: _list.h:106
list(size_type __n, const_reference __val=_STLP_DEFAULT_CONSTRUCTED(value_type), const allocator_type &__a=allocator_type())
Definition: _list.h:306
void assign(const value_type *__first2, const value_type *__last2)
Definition: _list.h:576
ptrdiff_t difference_type
Definition: _list.h:111
reference front()
Definition: _list.h:385
_STLP_PRIV _List_iterator< _Tp, _Nonconst_traits< _Tp > > iterator
Definition: _list.h:275
GLint reference
Definition: glext.h:11729
#define _STLP_PRIV
Definition: _dm.h:70
void _Destroy(_Tp *__pointer)
Definition: _construct.h:63
_STLP_MOVE_TO_PRIV_NAMESPACE void _S_remove_if(list< _Tp, _Alloc > &__that, _Predicate __pred)
Definition: _list.c:139
static void _STLP_CALL _Transfer(_Node_base *__pos, _Node_base *__first, _Node_base *__last)
void insert(iterator __pos, const_iterator __first, const_iterator __last)
Definition: _list.h:490
Definition: _list.h:228
GLenum src
Definition: glext.h:6340
_Self operator--(int)
Definition: _list.h:135
bool operator!=(const_iterator __y) const
Definition: _list.h:143
void insert(iterator __pos, size_type __n, const_reference __x)
Definition: _list.h:498
bidirectional_iterator_tag iterator_category
Definition: _list.h:108
void swap(_Self &__x)
Definition: _alloc.h:520
void _Construct(_T1 *__p)
Definition: _construct.h:106
_AllocProxy _M_node
Definition: _list.h:216
void _M_empty_initialize()
Definition: _list.h:210
#define __CONST_CAST(__x, __y)
Definition: features.h:584
void _S_sort(list< _Tp, _Alloc > &__that, _StrictWeakOrdering __comp)
Definition: _list.c:206
const_iterator end() const
Definition: _list.h:371
_Tp value_type
Definition: _list.h:263
_Self & operator--()
Definition: _list.h:131
void clear()
Definition: _list.c:66
__bool2type< trivial_assign >::_Ret has_trivial_assignment_operator
iterator end()
Definition: _list.h:370
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define _STLP_TRY
Definition: features.h:817
_List_node_base * _M_next
Definition: _list.h:58
__bool2type< trivial_copy >::_Ret has_trivial_copy_constructor
size_type max_size() const
Definition: _list.h:383
__kernel_ptrdiff_t ptrdiff_t
Definition: linux.h:247
void push_front(const_reference __x)
Definition: _list.h:508
iterator erase(iterator __first, iterator __last)
Definition: _list.h:529
#define _STLP_ASSERT(expr)
Definition: _debug.h:165
reverse_iterator rend()
Definition: _list.h:376
#define _STLP_DEFINE_ARROW_OPERATOR
reverse_iterator rbegin()
Definition: _list.h:373
_Traits::_ConstTraits _ConstTraits
Definition: _list.h:105
_List_node< _Tp > _Node
Definition: _list.h:109
size_t size_type
Definition: _list.h:83
list(__move_source< _Self > src)
Definition: _list.h:359
_List_global< bool > _List_global_inst
Definition: _list.h:73
bool empty() const
Definition: _list.h:177
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
_List_node_base * _M_prev
Definition: _list.h:59
_STLP_DEFINE_ARROW_OPERATOR _Self & operator++()
Definition: _list.h:122
value_type * pointer
Definition: _list.h:264
_Traits::_NonConstTraits _NonConstTraits
Definition: _list.h:103
static BOOL complete
Definition: htmldoc.c:198
_List_iterator(const iterator &__x)
Definition: _list.h:116
#define _STLP_CALL
Definition: _bc.h:131
_Alloc_traits< _Node, _Alloc >::allocator_type _Node_allocator_type
Definition: _list.h:180
void _M_insert(iterator __pos, const_iterator __first, const_iterator __last)
Definition: _list.h:458
void assign(size_type __n, const_reference __val)
Definition: _list.h:555
__bool2type< trivial_destructor >::_Ret has_trivial_destructor
_List_iterator(_List_node_base *__x)
Definition: _list.h:113
value_type & reference
Definition: _list.h:266
_Self & operator=(const _Self &__x)
Definition: _list.c:107
bidirectional_iterator_tag iterator_category
Definition: _list.h:85
#define __TRIVIAL_STUFF(__type)
Definition: features.h:799
_Traits::pointer pointer
Definition: _list.h:99
const value_type * const_pointer
Definition: _list.h:265
#define _STLP_FORCE_ALLOCATORS(a, y)
Definition: _alloc.h:436