---
name: "__gnu_debug::def_list"
section: "3"
platform: "linux"
package: "libstdc++6-doc"
version: "3.4.6-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_debug::def_list"
---

# \_\_gnu\_debug::def\_list(3)

## NAME

\_\_gnu\_debug\_def::list -

## SYNOPSIS

Inherits **std::list\< Type, Allocator \>**, and **\_\_gnu\_debug::Safe\_sequence\< Sequence \>\< \_\_gnu\_debug\_def::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)\
 *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** ()\

## 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

### 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\>\> void \_\_gnu\_debug\_def::list\< Type, Allocator \>::assign (size\_type n, const Type & \_\_t)` [inline]`

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.

Reimplemented from **std::list\< Type, Allocator \>**.

Definition at line 107 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 \>::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().

### 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 \>::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().

### 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\>\> 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\>\> 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 \>::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().

### 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\>\> 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.

### 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 \>::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\_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\>\> 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().

### 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.

References \_\_gnu\_debug\_def::list\< Type, Allocator \>::end().

### 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.

### 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.

References \_\_gnu\_debug::Safe\_iterator\< Iterator, Sequence \>::base(), \_\_gnu\_debug\_def::list\< Type, Allocator \>::begin(), and \_\_gnu\_debug\_def::list\< Type, Allocator \>::erase().

### 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.

References \_\_gnu\_debug::Safe\_iterator\< Iterator, Sequence \>::base(), \_\_gnu\_debug\_def::list\< Type, Allocator \>::begin(), and \_\_gnu\_debug\_def::list\< Type, Allocator \>::erase().

### 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.

References \_\_gnu\_debug\_def::list\< Type, Allocator \>::begin(), \_\_gnu\_debug\_def::list\< Type, Allocator \>::end(), and \_\_gnu\_debug\_def::list\< Type, Allocator \>::erase().

### 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.

References \_\_gnu\_debug\_def::list\< Type, Allocator \>::begin(), \_\_gnu\_debug\_def::list\< Type, Allocator \>::end(), and \_\_gnu\_debug\_def::list\< Type, Allocator \>::erase().

### 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().

### 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().

### 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.

### 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().

### 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 \>::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 \>::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 \>::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.

### 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.

### 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 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.

### 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.

### 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.

### 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.

### 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 \_\_gnu\_cxx::swap().

### 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 \>::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 \> &, 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 \>::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.

### 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 \>::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.

### template\<typename Sequence\> template\<typename Predicate\> void \_\_gnu\_debug::Safe\_sequence\< Sequence \>::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.

Definition at line 120 of file safe\_sequence.h.

### template\<typename Sequence\> template\<typename Iterator\> void \_\_gnu\_debug::Safe\_sequence\< Sequence \>::M\_transfer\_iter (const Safe\_iterator\< Iterator, Sequence \> & x)` [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]`

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\_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\_base::M\_invalidate\_all () const` [inline, inherited]`

Invalidates all iterators.

Definition at line 202 of file safe\_base.h.

## Member Data Documentation

### 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.

## Author

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