Public Types | |
typedef Allocator::reference | reference |
typedef Allocator::const_reference | const_reference |
typedef __gnu_debug::Safe_iterator < typename Base::iterator, list > | iterator |
typedef __gnu_debug::Safe_iterator < typename Base::const_iterator, list > | const_iterator |
typedef Base::size_type | size_type |
typedef Base::difference_type | difference_type |
typedef Type | value_type |
typedef Allocator | allocator_type |
typedef Allocator::pointer | pointer |
typedef Allocator::const_pointer | const_pointer |
typedef std::reverse_iterator < iterator > | reverse_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
Public Member Functions | |
list (const Allocator &a=Allocator()) | |
list (size_type n, const Type &value=Type(), const Allocator &a=Allocator()) | |
template<class InputIterator> | |
list (InputIterator first, InputIterator last, const Allocator &a=Allocator()) | |
list (const list &x) | |
list (const Base &x) | |
~list () | |
list & | operator= (const list &x) |
template<class InputIterator> | |
void | assign (InputIterator first, InputIterator last) |
Assigns a range to a list. | |
void | assign (size_type n, const Type &__t) |
Assigns a given value to a list. | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
void | resize (size_type sz, Type c=Type()) |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
void | pop_front () |
Removes first element. | |
void | pop_back () |
Removes last element. | |
iterator | insert (iterator position, const Type &x) |
void | insert (iterator position, size_type n, const Type &x) |
template<class InputIterator> | |
void | insert (iterator position, InputIterator first, InputIterator last) |
iterator | erase (iterator position) |
iterator | erase (iterator position, iterator last) |
void | swap (list &x) |
void | clear () |
void | splice (iterator position, list &x) |
void | splice (iterator position, list &x, iterator __i) |
void | splice (iterator position, list &x, iterator first, iterator last) |
void | remove (const Type &value) |
Remove all elements equal to value. | |
template<class Predicate> | |
void | remove_if (Predicate pred) |
Remove all elements satisfying a predicate. | |
void | unique () |
Remove consecutive duplicate elements. | |
template<class BinaryPredicate> | |
void | unique (BinaryPredicate __binary_pred) |
Remove consecutive elements satisfying a predicate. | |
void | merge (list &x) |
template<class Compare> | |
void | merge (list &x, Compare comp) |
void | sort () |
Sort the elements. | |
template<typename StrictWeakOrdering> | |
void | sort (StrictWeakOrdering pred) |
Sort the elements according to comparison function. | |
Base & | M_base () |
const Base & | M_base () const |
allocator_type | get_allocator () const |
Get a copy of the memory allocation object. | |
bool | empty () const |
size_type | size () const |
size_type | max_size () const |
void | resize (size_type new_size, const value_type &x) |
Resizes the list to the specified number of elements. | |
void | resize (size_type new_size) |
Resizes the list to the specified number of elements. | |
void | push_front (const value_type &x) |
Add data to the front of the list. | |
void | push_back (const value_type &x) |
Add data to the end of the list. | |
iterator | insert (iterator position, const value_type &x) |
Inserts given value into list before specified iterator. | |
void | insert (iterator position, size_type n, const value_type &x) |
Inserts a number of copies of given data into the list. | |
void | insert (iterator position, InputIterator first, InputIterator last) |
Inserts a range into the list. | |
iterator | erase (iterator position) |
Remove element at given position. | |
iterator | erase (iterator first, iterator last) |
Remove a range of elements. | |
void | swap (list &x) |
Swaps data with another list. | |
void | splice (iterator position, list &x) |
Insert contents of another list. | |
void | splice (iterator position, list &, iterator __i) |
Insert element from another list. | |
void | splice (iterator position, list &, iterator first, iterator last) |
Insert range from another list. | |
void | merge (list &x) |
Merge sorted lists. | |
void | merge (list &, StrictWeakOrdering) |
Merge sorted lists according to comparison function. | |
void | reverse () |
Reverse the elements in list. | |
template<typename Predicate> | |
void | M_invalidate_if (Predicate pred) |
template<typename Iterator> | |
void | M_transfer_iter (const Safe_iterator< Iterator, Sequence > &x) |
void | M_invalidate_all () const |
Public Attributes | |
Safe_iterator_base * | M_iterators |
The list of mutable iterators that reference this container. | |
Safe_iterator_base * | M_const_iterators |
The list of constant iterators that reference this container. | |
unsigned int | M_version |
The container version number. This number may never be 0. | |
Protected Types | |
typedef List_node< Type > | Node |
typedef Allocator::template rebind< List_node < Type > >::other | NodeAlloc_type |
Protected Member Functions | |
Node * | M_create_node (const value_type &x) |
Node * | M_create_node () |
void | M_assign_dispatch (Integer n, Integer __val, __true_type) |
void | M_insert_dispatch (iterator position, Integer n, Integer x, __true_type) |
void | M_insert_dispatch (iterator position, InputIterator first, InputIterator last, __false_type) |
void | M_fill_insert (iterator position, size_type n, const value_type &x) |
void | M_transfer (iterator position, iterator first, iterator last) |
void | M_insert (iterator position, const value_type &x) |
void | M_erase (iterator position) |
List_node< Type > * | M_get_node () |
void | M_put_node (List_node< Type > *__p) |
void | M_init () |
void | M_detach_all () |
void | M_detach_singular () |
void | M_revalidate_singular () |
void | M_swap (Safe_sequence_base &x) |
Protected Attributes | |
List_impl | M_impl |
Private Types | |
typedef std::list < Type, Allocator > | Base |
typedef __gnu_debug::Safe_sequence < list > | Safe_base |
Private Member Functions | |
void | M_invalidate_all () |
Definition at line 42 of file debug/list.
void __gnu_debug_def::list< Type, Allocator >::assign | ( | InputIterator | first, | |
InputIterator | last | |||
) | [inline] |
Assigns a range to a list.
first | An input iterator. | |
last | An input iterator. |
Note that the assignment completely changes the list and that the resulting list's size is the same as the number of elements assigned. Old data may be lost.
Reimplemented from std::list< Type, Allocator >.
Definition at line 99 of file debug/list.
void __gnu_debug_def::list< Type, Allocator >::assign | ( | size_type | n, | |
const Type & | __val | |||
) | [inline] |
Assigns a given value to a list.
n | Number of elements to be assigned. | |
val | Value to be assigned. |
Reimplemented from std::list< Type, Allocator >.
Definition at line 107 of file debug/list.
iterator __gnu_debug_def::list< Type, Allocator >::begin | ( | ) | [inline] |
Returns a read/write iterator that points to the first element in the list. Iteration is done in ordinary element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 117 of file debug/list.
Referenced by __gnu_debug_def::list< Type, Allocator >::merge(), __gnu_debug_def::list< Type, Allocator >::pop_front(), __gnu_debug_def::list< Type, Allocator >::remove(), __gnu_debug_def::list< Type, Allocator >::remove_if(), __gnu_debug_def::list< Type, Allocator >::rend(), __gnu_debug_def::list< Type, Allocator >::resize(), __gnu_debug_def::list< Type, Allocator >::splice(), and __gnu_debug_def::list< Type, Allocator >::unique().
const_iterator __gnu_debug_def::list< Type, Allocator >::begin | ( | ) | const [inline] |
Returns a read-only (constant) iterator that points to the first element in the list. Iteration is done in ordinary element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 121 of file debug/list.
iterator __gnu_debug_def::list< Type, Allocator >::end | ( | ) | [inline] |
Returns a read/write iterator that points one past the last element in the list. Iteration is done in ordinary element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 125 of file debug/list.
Referenced by __gnu_debug_def::list< Type, Allocator >::M_invalidate_all(), __gnu_debug_def::list< Type, Allocator >::merge(), __gnu_debug_def::list< Type, Allocator >::pop_back(), __gnu_debug_def::list< Type, Allocator >::rbegin(), __gnu_debug_def::list< Type, Allocator >::resize(), __gnu_debug_def::list< Type, Allocator >::splice(), and __gnu_debug_def::list< Type, Allocator >::unique().
const_iterator __gnu_debug_def::list< Type, Allocator >::end | ( | ) | const [inline] |
Returns a read-only (constant) iterator that points one past the last element in the list. Iteration is done in ordinary element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 129 of file debug/list.
reverse_iterator __gnu_debug_def::list< Type, Allocator >::rbegin | ( | ) | [inline] |
Returns a read/write reverse iterator that points to the last element in the list. Iteration is done in reverse element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 133 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::end().
const_reverse_iterator __gnu_debug_def::list< Type, Allocator >::rbegin | ( | ) | const [inline] |
Returns a read-only (constant) reverse iterator that points to the last element in the list. Iteration is done in reverse element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 137 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::end().
reverse_iterator __gnu_debug_def::list< Type, Allocator >::rend | ( | ) | [inline] |
Returns a read/write reverse iterator that points to one before the first element in the list. Iteration is done in reverse element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 141 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::begin().
const_reverse_iterator __gnu_debug_def::list< Type, Allocator >::rend | ( | ) | const [inline] |
Returns a read-only (constant) reverse iterator that points to one before the first element in the list. Iteration is done in reverse element order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 145 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::begin().
reference __gnu_debug_def::list< Type, Allocator >::front | ( | ) | [inline] |
Returns a read/write reference to the data at the first element of the list.
Reimplemented from std::list< Type, Allocator >.
Definition at line 183 of file debug/list.
const_reference __gnu_debug_def::list< Type, Allocator >::front | ( | ) | const [inline] |
Returns a read-only (constant) reference to the data at the first element of the list.
Reimplemented from std::list< Type, Allocator >.
Definition at line 190 of file debug/list.
reference __gnu_debug_def::list< Type, Allocator >::back | ( | ) | [inline] |
Returns a read/write reference to the data at the last element of the list.
Reimplemented from std::list< Type, Allocator >.
Definition at line 197 of file debug/list.
const_reference __gnu_debug_def::list< Type, Allocator >::back | ( | ) | const [inline] |
Returns a read-only (constant) reference to the data at the last element of the list.
Reimplemented from std::list< Type, Allocator >.
Definition at line 204 of file debug/list.
void __gnu_debug_def::list< Type, Allocator >::pop_front | ( | ) | [inline] |
Removes first element.
This is a typical stack operation. It shrinks the list by one. Due to the nature of a list this operation can be done in constant time, and only invalidates iterators/references to the element being removed.
Note that no data is returned, and if the first element's data is needed, it should be retrieved before pop_front() is called.
Reimplemented from std::list< Type, Allocator >.
Definition at line 214 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::begin().
void __gnu_debug_def::list< Type, Allocator >::pop_back | ( | ) | [inline] |
Removes last element.
This is a typical stack operation. It shrinks the list by one. Due to the nature of a list this operation can be done in constant time, and only invalidates iterators/references to the element being removed.
Note that no data is returned, and if the last element's data is needed, it should be retrieved before pop_back() is called.
Reimplemented from std::list< Type, Allocator >.
Definition at line 225 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::end().
void __gnu_debug_def::list< Type, Allocator >::clear | ( | ) | [inline] |
Erases all the elements. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibilty.
Reimplemented from std::list< Type, Allocator >.
Definition at line 288 of file debug/list.
void __gnu_debug_def::list< Type, Allocator >::remove | ( | const Type & | value | ) | [inline] |
Remove all elements equal to value.
value | The value to remove. |
Reimplemented from std::list< Type, Allocator >.
Definition at line 355 of file debug/list.
References __gnu_debug::Safe_iterator< Iterator, Sequence >::base(), __gnu_debug_def::list< Type, Allocator >::begin(), and __gnu_debug_def::list< Type, Allocator >::erase().
void __gnu_debug_def::list< Type, Allocator >::remove_if | ( | Predicate | ) | [inline] |
Remove all elements satisfying a predicate.
Predicate | Unary predicate function or object. |
Reimplemented from std::list< Type, Allocator >.
Definition at line 368 of file debug/list.
References __gnu_debug::Safe_iterator< Iterator, Sequence >::base(), __gnu_debug_def::list< Type, Allocator >::begin(), and __gnu_debug_def::list< Type, Allocator >::erase().
void __gnu_debug_def::list< Type, Allocator >::unique | ( | ) | [inline] |
Remove consecutive duplicate elements.
For each consecutive set of elements with the same value, remove all but the first one. Remaining elements stay in list order. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibilty.
Reimplemented from std::list< Type, Allocator >.
Definition at line 380 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::begin(), __gnu_debug_def::list< Type, Allocator >::end(), and __gnu_debug_def::list< Type, Allocator >::erase().
void __gnu_debug_def::list< Type, Allocator >::unique | ( | BinaryPredicate | ) | [inline] |
Remove consecutive elements satisfying a predicate.
BinaryPredicate | Binary predicate function or object. |
Reimplemented from std::list< Type, Allocator >.
Definition at line 399 of file debug/list.
References __gnu_debug_def::list< Type, Allocator >::begin(), __gnu_debug_def::list< Type, Allocator >::end(), and __gnu_debug_def::list< Type, Allocator >::erase().
void __gnu_debug_def::list< Type, Allocator >::sort | ( | ) | [inline] |
Sort the elements.
Sorts the elements of this list in NlogN time. Equivalent elements remain in list order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 445 of file debug/list.
References std::sort().
void __gnu_debug_def::list< Type, Allocator >::sort | ( | StrictWeakOrdering | ) | [inline] |
Sort the elements according to comparison function.
Sorts the elements of this list in NlogN time. Equivalent elements remain in list order.
Reimplemented from std::list< Type, Allocator >.
Definition at line 449 of file debug/list.
References std::sort().
allocator_type std::list< Type , Allocator >::get_allocator | ( | ) | const [inline, inherited] |
Get a copy of the memory allocation object.
Reimplemented from std::List_base< Type, Allocator >.
Definition at line 590 of file stl_list.h.
Referenced by __gnu_debug_def::list< Type, Allocator >::splice().
bool std::list< Type , Allocator >::empty | ( | ) | const [inline, inherited] |
Returns true if the list is empty. (Thus begin() would equal end().)
Definition at line 670 of file stl_list.h.
Returns the number of elements in the list.
Definition at line 675 of file stl_list.h.
References std::distance().
Returns the size() of the largest possible list.
Definition at line 680 of file stl_list.h.
void std::list< Type , Allocator >::resize | ( | size_type | new_size, | |
const value_type & | x | |||
) | [inherited] |
Resizes the list to the specified number of elements.
new_size | Number of elements the list should contain. | |
x | Data with which new elements should be populated. |
Resizes the list to the specified number of elements.
new_size | Number of elements the list should contain. |
Definition at line 706 of file stl_list.h.
void std::list< Type , Allocator >::push_front | ( | const value_type & | x | ) | [inline, inherited] |
Add data to the front of the list.
x | Data to be added. |
Definition at line 754 of file stl_list.h.
void std::list< Type , Allocator >::push_back | ( | const value_type & | x | ) | [inline, inherited] |
Add data to the end of the list.
x | Data to be added. |
Definition at line 784 of file stl_list.h.
iterator std::list< Type , Allocator >::insert | ( | iterator | position, | |
const value_type & | x | |||
) | [inherited] |
Inserts given value into list before specified iterator.
position | An iterator into the list. | |
x | Data to be inserted. |
void std::list< Type , Allocator >::insert | ( | iterator | position, | |
size_type | n, | |||
const value_type & | x | |||
) | [inline, inherited] |
Inserts a number of copies of given data into the list.
position | An iterator into the list. | |
n | Number of elements to be inserted. | |
x | Data to be inserted. |
Due to the nature of a list this operation can be done in constant time, and does not invalidate iterators and references.
Definition at line 830 of file stl_list.h.
void std::list< Type , Allocator >::insert | ( | iterator | position, | |
InputIterator | first, | |||
InputIterator | last | |||
) | [inline, inherited] |
Inserts a range into the list.
This function will insert copies of the data in the range [first,last) into the list before the location specified by position.
Due to the nature of a list this operation can be done in constant time, and does not invalidate iterators and references.
Definition at line 849 of file stl_list.h.
Remove element at given position.
position | Iterator pointing to element to be erased. |
Due to the nature of a list this operation can be done in constant time, and only invalidates iterators/references to the element being removed. The user is also cautioned that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibilty.
Remove a range of elements.
first | Iterator pointing to the first element to be erased. | |
last | Iterator pointing to one past the last element to be erased. |
Due to the nature of a list this operation can be done in constant time, and only invalidates iterators/references to the element being removed. The user is also cautioned that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibilty.
Definition at line 895 of file stl_list.h.
Swaps data with another list.
x | A list of the same element and allocator types. |
Definition at line 912 of file stl_list.h.
References __gnu_cxx::swap().
void std::list< Type , Allocator >::splice | ( | iterator | position, | |
list< Type, Allocator > & | x | |||
) | [inline, inherited] |
Insert contents of another list.
position | Iterator referencing the element to insert before. | |
x | Source list. |
Definition at line 939 of file stl_list.h.
References std::list< Type, Alloc >::begin(), std::list< Type, Alloc >::empty(), and std::list< Type, Alloc >::end().
void std::list< Type , Allocator >::splice | ( | iterator | position, | |
list< Type, Allocator > & | , | |||
iterator | __i | |||
) | [inline, inherited] |
Insert element from another list.
position | Iterator referencing the element to insert before. | |
x | Source list. | |
i | Iterator referencing the element to move. |
Definition at line 955 of file stl_list.h.
void std::list< Type , Allocator >::splice | ( | iterator | position, | |
list< Type, Allocator > & | , | |||
iterator | first, | |||
iterator | last | |||
) | [inline, inherited] |
Insert range from another list.
position | Iterator referencing the element to insert before. | |
x | Source list. | |
first | Iterator referencing the start of range in x. | |
last | Iterator referencing the end of range in x. |
Undefined if position is in [first,last).
Definition at line 977 of file stl_list.h.
Merge sorted lists.
x | Sorted list to merge. |
void std::list< Type , Allocator >::merge | ( | list< Type, Allocator > & | , | |
StrictWeakOrdering | ||||
) | [inline, inherited] |
Merge sorted lists according to comparison function.
x | Sorted list to merge. | |
StrictWeakOrdering | Comparison function definining sort order. |
void std::list< Type , Allocator >::reverse | ( | ) | [inline, inherited] |
Reverse the elements in list.
Reverse the order of elements in the list in linear time.
Definition at line 1075 of file stl_list.h.
void __gnu_debug::Safe_sequence< Sequence >::M_invalidate_if | ( | Predicate | pred | ) | [inline, inherited] |
Invalidates all iterators x
that reference this sequence, are not singular, and for which pred(x)
returns true
. The user of this routine should be careful not to make copies of the iterators passed to pred
, as the copies may interfere with the invalidation.
Definition at line 120 of file safe_sequence.h.
void __gnu_debug::Safe_sequence< Sequence >::M_transfer_iter | ( | const Safe_iterator< Iterator, Sequence > & | x | ) | [inline, inherited] |
Transfers all iterators that reference this memory location to this sequence from whatever sequence they are attached to.
Definition at line 152 of file safe_sequence.h.
void __gnu_debug::Safe_sequence_base::M_detach_all | ( | ) | [protected, inherited] |
void __gnu_debug::Safe_sequence_base::M_detach_singular | ( | ) | [protected, inherited] |
void __gnu_debug::Safe_sequence_base::M_revalidate_singular | ( | ) | [protected, inherited] |
void __gnu_debug::Safe_sequence_base::M_swap | ( | Safe_sequence_base & | x | ) | [protected, inherited] |
Swap this sequence with the given sequence. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.
Definition at line 172 of file debug.cc.
References __gnu_debug::swap().
void __gnu_debug::Safe_sequence_base::M_invalidate_all | ( | ) | const [inline, inherited] |
Invalidates all iterators.
Definition at line 202 of file safe_base.h.
Safe_iterator_base* __gnu_debug::Safe_sequence_base::M_iterators [inherited] |
The list of mutable iterators that reference this container.
Definition at line 153 of file safe_base.h.
Safe_iterator_base* __gnu_debug::Safe_sequence_base::M_const_iterators [inherited] |
The list of constant iterators that reference this container.
Definition at line 156 of file safe_base.h.
unsigned int __gnu_debug::Safe_sequence_base::M_version [mutable, inherited] |
The container version number. This number may never be 0.
Definition at line 159 of file safe_base.h.