man __gnu_debug::def_list (Fonctions bibliothèques) -

NAME

__gnu_debug_def::list -

SYNOPSIS



Inherits std::list< Type, Allocator >, and __gnu_debug::Safe_sequence< list< Type, Allocator > >.

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)

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

void assign (size_type n, const value_type &__val)

Assigns a given value to a list. 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. void M_invalidate_if (Predicate pred)

void M_transfer_iter (const Safe_iterator< Iterator, list< Type, Allocator > > &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 ()

Detailed Description

template<typename Type, typename Allocator = std::allocator<Type>> class __gnu_debug_def::list< Type, Allocator >

Definition at line 42 of file debug/list.

Member Function Documentation

void std::list< Type , Allocator >::assign (size_type n, const value_type & __val) [inline, inherited]

Assigns a given value to a list.

Parameters: n Number of elements to be assigned.

val Value to be assigned.

This function fills a list with n copies of the given value. 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.

Definition at line 564 of file stl_list.h.

template<typename Type, typename Allocator = std::allocator<Type>> template<class InputIterator> void __gnu_debug_def::list< Type, Allocator >::assign (InputIterator first, InputIterator last) [inline]

Assigns a range to a list.

Parameters: first An input iterator.

last An input iterator.

This function fills a list with copies of the elements in the range [first,last).

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.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

template<typename Type, typename Allocator = std::allocator<Type>> 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 >::rend(), __gnu_debug_def::list< Type, Allocator >::resize(), and __gnu_debug_def::list< Type, Allocator >::splice().

template<typename Type, typename Allocator = std::allocator<Type>> 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.

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.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

template<typename Type, typename Allocator = std::allocator<Type>> 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 >::merge(), __gnu_debug_def::list< Type, Allocator >::rbegin(), __gnu_debug_def::list< Type, Allocator >::resize(), and __gnu_debug_def::list< Type, Allocator >::splice().

iterator std::list< Type , Allocator >::erase (iterator first, iterator last) [inline, inherited]

Remove a range of elements.

Parameters: first Iterator pointing to the first element to be erased.

last Iterator pointing to one past the last element to be erased.

Returns: An iterator pointing to the element pointed to by last prior to erasing (or end()).

This function will erase the elements in the range [first,last) and shorten the list accordingly.

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.

iterator std::list< Type , Allocator >::erase (iterator position) [inherited]

Remove element at given position.

Parameters: position Iterator pointing to element to be erased.

Returns: An iterator pointing to the next element (or end()).

This function will erase the element at the given position and thus shorten 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. 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.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

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.

void std::list< Type , Allocator >::insert (iterator position, InputIterator first, InputIterator last) [inline, inherited]

Inserts a range into the list.

Parameters: position An iterator into the list.

first An input iterator.

last An input iterator.

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.

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.

Parameters: position An iterator into the list.

n Number of elements to be inserted.

x Data to be inserted.

This function will insert a specified number of copies of the given data 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 830 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.

Parameters: position An iterator into the list.

x Data to be inserted.

Returns: An iterator that points to the inserted data.

This function will insert a copy of the given value before the specified location. Due to the nature of a list this operation can be done in constant time, and does not invalidate iterators and references.

void __gnu_debug::Safe_sequence_base::M_detach_all () [protected, inherited]

Detach all iterators, leaving them singular.

Definition at line 114 of file debug.cc.

void __gnu_debug::Safe_sequence_base::M_detach_singular () [protected, inherited]

Detach all singular iterators.

Postcondition: for all iterators i attached to this sequence, i->M_version == M_version.

Definition at line 133 of file debug.cc.

void __gnu_debug::Safe_sequence_base::M_invalidate_all () const [inline, inherited]

Invalidates all iterators.

Definition at line 202 of file safe_base.h.

void __gnu_debug::Safe_sequence< list< Type, Allocator > >::M_invalidate_if (Predicate pred) [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.

void __gnu_debug::Safe_sequence_base::M_revalidate_singular () [protected, inherited]

Revalidates all attached singular iterators. This method may be used to validate iterators that were invalidated before (but for some reasion, such as an exception, need to become valid again).

Definition at line 154 of file debug.cc.

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< list< Type, Allocator > >::M_transfer_iter (const Safe_iterator< Iterator, list< Type, Allocator > > & x) [inherited]

Transfers all iterators that reference this memory location to this sequence from whatever sequence they are attached to.

size_type std::list< Type , Allocator >::max_size (void) const [inline, inherited]

Returns the size() of the largest possible list.

Definition at line 680 of file stl_list.h.

void std::list< Type , Allocator >::merge (list< Type, Allocator > &, StrictWeakOrdering) [inherited]

Merge sorted lists according to comparison function.

Parameters: x Sorted list to merge.

StrictWeakOrdering Comparison function definining sort order.

Assumes that both x and this list are sorted according to StrictWeakOrdering. Merges elements of x into this list in sorted order, leaving x empty when complete. Elements in this list precede elements in x that are equivalent according to StrictWeakOrdering().

void std::list< Type , Allocator >::merge (list< Type, Allocator > & x) [inherited]

Merge sorted lists.

Parameters: x Sorted list to merge.

Assumes that both x and this list are sorted according to operator<(). Merges elements of x into this list in sorted order, leaving x empty when complete. Elements in this list precede elements in x that are equal.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

void std::list< Type , Allocator >::push_back (const value_type & x) [inline, inherited]

Add data to the end of the list.

Parameters: x Data to be added.

This is a typical stack operation. The function creates an element at the end of the list and assigns the given data to it. 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 784 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.

Parameters: x Data to be added.

This is a typical stack operation. The function creates an element at the front of the list and assigns the given data to it. 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 754 of file stl_list.h.

template<typename Type, typename Allocator = std::allocator<Type>> 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().

template<typename Type, typename Allocator = std::allocator<Type>> 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().

template<typename Type, typename Allocator = std::allocator<Type>> void __gnu_debug_def::list< Type, Allocator >::remove (const Type & value) [inline]

Remove all elements equal to value.

Parameters: value The value to remove.

Removes every element in the list equal to value. 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 355 of file debug/list.

template<typename Type, typename Allocator = std::allocator<Type>> template<class Predicate> void __gnu_debug_def::list< Type, Allocator >::remove_if (Predicate pred) [inline]

Remove all elements satisfying a predicate.

Parameters: Predicate Unary predicate function or object.

Removes every element in the list for which the predicate returns true. 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 368 of file debug/list.

template<typename Type, typename Allocator = std::allocator<Type>> 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().

template<typename Type, typename Allocator = std::allocator<Type>> 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().

void std::list< Type , Allocator >::resize (size_type new_size) [inline, inherited]

Resizes the list to the specified number of elements.

Parameters: new_size Number of elements the list should contain.

This function will resize the list to the specified number of elements. If the number is smaller than the list's current size the list is truncated, otherwise the list is extended and new elements are default-constructed.

Definition at line 706 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.

Parameters: new_size Number of elements the list should contain.

x Data with which new elements should be populated.

This function will resize the list to the specified number of elements. If the number is smaller than the list's current size the list is truncated, otherwise the list is extended and new elements are populated with given data.

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.

size_type std::list< Type , Allocator >::size () const [inline, inherited]

Returns the number of elements in the list.

Definition at line 675 of file stl_list.h.

References std::distance().

template<typename Type, typename Allocator = std::allocator<Type>> template<typename StrictWeakOrdering> void __gnu_debug_def::list< Type, Allocator >::sort (StrictWeakOrdering pred) [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().

template<typename Type, typename Allocator = std::allocator<Type>> 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 std::list< Type , Allocator >::splice (iterator position, list< Type, Allocator > &, iterator first, iterator last) [inline, inherited]

Insert range from another list.

Parameters: 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.

Removes elements in the range [first,last) and inserts them before position in constant time.

Undefined if position is in [first,last).

Definition at line 977 of file stl_list.h.

void std::list< Type , Allocator >::splice (iterator position, list< Type, Allocator > &, iterator __i) [inline, inherited]

Insert element from another list.

Parameters: position Iterator referencing the element to insert before.

x Source list.

i Iterator referencing the element to move.

Removes the element in list x referenced by i and inserts it into the current list before position.

Definition at line 955 of file stl_list.h.

void std::list< Type , Allocator >::splice (iterator position, list< Type, Allocator > & x) [inline, inherited]

Insert contents of another list.

Parameters: position Iterator referencing the element to insert before.

x Source list.

The elements of x are inserted in constant time in front of the element referenced by position. x becomes an empty 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 >::swap (list< Type, Allocator > & x) [inline, inherited]

Swaps data with another list.

Parameters: x A list of the same element and allocator types.

This exchanges the elements between two lists in constant time. Note that the global std::swap() function is specialized such that std::swap(l1,l2) will feed to this function.

Definition at line 912 of file stl_list.h.

References std::swap().

template<typename Type, typename Allocator = std::allocator<Type>> template<class BinaryPredicate> void __gnu_debug_def::list< Type, Allocator >::unique (BinaryPredicate __binary_pred) [inline]

Remove consecutive elements satisfying a predicate.

Parameters: BinaryPredicate Binary predicate function or object.

For each consecutive set of elements [first,last) that satisfy predicate(first,i) where i is an iterator in [first,last), 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 399 of file debug/list.

template<typename Type, typename Allocator = std::allocator<Type>> 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.

Member Data Documentation

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.

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.

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.

Author

Generated automatically by Doxygen for libstdc++-v3 Source from the source code.