.TH "std::forward_list< _Tp, _Alloc >" 3cxx "Sun Jan 6 2013" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::forward_list< _Tp, _Alloc > \- .SH SYNOPSIS .br .PP .PP Inherits \fBstd::_Fwd_list_base< _Tp, _Alloc >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .ti -1c .RI "typedef .br \fB_Fwd_list_const_iterator\fP< _Tp > \fBconst_iterator\fP" .br .ti -1c .RI "typedef .br _Tp_alloc_type::const_pointer \fBconst_pointer\fP" .br .ti -1c .RI "typedef .br _Tp_alloc_type::const_reference \fBconst_reference\fP" .br .ti -1c .RI "typedef std::ptrdiff_t \fBdifference_type\fP" .br .ti -1c .RI "typedef \fB_Fwd_list_iterator\fP< _Tp > \fBiterator\fP" .br .ti -1c .RI "typedef _Tp_alloc_type::pointer \fBpointer\fP" .br .ti -1c .RI "typedef _Tp_alloc_type::reference \fBreference\fP" .br .ti -1c .RI "typedef std::size_t \fBsize_type\fP" .br .ti -1c .RI "typedef _Tp \fBvalue_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBforward_list\fP (const _Alloc &__al=_Alloc())" .br .ti -1c .RI "\fBforward_list\fP (const \fBforward_list\fP &__list, const _Alloc &__al)" .br .ti -1c .RI "\fBforward_list\fP (\fBforward_list\fP &&__list, const _Alloc &__al)" .br .ti -1c .RI "\fBforward_list\fP (size_type __n)" .br .ti -1c .RI "\fBforward_list\fP (size_type __n, const _Tp &__value, const _Alloc &__al=_Alloc())" .br .ti -1c .RI "template \fBforward_list\fP (_InputIterator __first, _InputIterator __last, const _Alloc &__al=_Alloc())" .br .ti -1c .RI "\fBforward_list\fP (const \fBforward_list\fP &__list)" .br .ti -1c .RI "\fBforward_list\fP (\fBforward_list\fP &&__list) noexcept" .br .ti -1c .RI "\fBforward_list\fP (\fBstd::initializer_list\fP< _Tp > __il, const _Alloc &__al=_Alloc())" .br .ti -1c .RI "\fB~forward_list\fP () noexcept" .br .ti -1c .RI "template void \fBassign\fP (_InputIterator __first, _InputIterator __last)" .br .ti -1c .RI "void \fBassign\fP (size_type __n, const _Tp &__val)" .br .ti -1c .RI "void \fBassign\fP (\fBstd::initializer_list\fP< _Tp > __il)" .br .ti -1c .RI "\fBiterator\fP \fBbefore_begin\fP () noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBbefore_begin\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBbegin\fP () noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBbegin\fP () const noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBcbefore_begin\fP () const noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBcbegin\fP () const noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBcend\fP () const noexcept" .br .ti -1c .RI "void \fBclear\fP () noexcept" .br .ti -1c .RI "template \fBiterator\fP \fBemplace_after\fP (\fBconst_iterator\fP __pos, _Args &&\&.\&.\&.__args)" .br .ti -1c .RI "template void \fBemplace_front\fP (_Args &&\&.\&.\&.__args)" .br .ti -1c .RI "bool \fBempty\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBend\fP () noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBend\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBerase_after\fP (\fBconst_iterator\fP __pos)" .br .ti -1c .RI "\fBiterator\fP \fBerase_after\fP (\fBconst_iterator\fP __pos, \fBconst_iterator\fP __last)" .br .ti -1c .RI "reference \fBfront\fP ()" .br .ti -1c .RI "const_reference \fBfront\fP () const " .br .ti -1c .RI "allocator_type \fBget_allocator\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, const _Tp &__val)" .br .ti -1c .RI "\fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, _Tp &&__val)" .br .ti -1c .RI "\fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, size_type __n, const _Tp &__val)" .br .ti -1c .RI "template \fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, _InputIterator __first, _InputIterator __last)" .br .ti -1c .RI "\fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, \fBstd::initializer_list\fP< _Tp > __il)" .br .ti -1c .RI "size_type \fBmax_size\fP () const noexcept" .br .ti -1c .RI "void \fBmerge\fP (\fBforward_list\fP &&__list)" .br .ti -1c .RI "void \fBmerge\fP (\fBforward_list\fP &__list)" .br .ti -1c .RI "template void \fBmerge\fP (\fBforward_list\fP &&__list, _Comp __comp)" .br .ti -1c .RI "template void \fBmerge\fP (\fBforward_list\fP &__list, _Comp __comp)" .br .ti -1c .RI "\fBforward_list\fP & \fBoperator=\fP (const \fBforward_list\fP &__list)" .br .ti -1c .RI "\fBforward_list\fP & \fBoperator=\fP (\fBforward_list\fP &&__list)" .br .ti -1c .RI "\fBforward_list\fP & \fBoperator=\fP (\fBstd::initializer_list\fP< _Tp > __il)" .br .ti -1c .RI "void \fBpop_front\fP ()" .br .ti -1c .RI "void \fBpush_front\fP (const _Tp &__val)" .br .ti -1c .RI "void \fBpush_front\fP (_Tp &&__val)" .br .ti -1c .RI "void \fBremove\fP (const _Tp &__val)" .br .ti -1c .RI "template void \fBremove_if\fP (_Pred __pred)" .br .ti -1c .RI "void \fBresize\fP (size_type __sz)" .br .ti -1c .RI "void \fBresize\fP (size_type __sz, const value_type &__val)" .br .ti -1c .RI "void \fBreverse\fP () noexcept" .br .ti -1c .RI "void \fBsort\fP ()" .br .ti -1c .RI "template void \fBsort\fP (_Comp __comp)" .br .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &&__list)" .br .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &__list)" .br .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &&__list, \fBconst_iterator\fP __i)" .br .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &__list, \fBconst_iterator\fP __i)" .br .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &&, \fBconst_iterator\fP __before, \fBconst_iterator\fP __last)" .br .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &, \fBconst_iterator\fP __before, \fBconst_iterator\fP __last)" .br .ti -1c .RI "void \fBswap\fP (\fBforward_list\fP &__list)" .br .ti -1c .RI "void \fBunique\fP ()" .br .ti -1c .RI "template void \fBunique\fP (_BinPred __binary_pred)" .br .in -1c .SS "Private Member Functions" .in +1c .ti -1c .RI "template \fB_Node\fP * \fB_M_create_node\fP (_Args &&\&.\&.\&.__args)" .br .ti -1c .RI "\fB_Fwd_list_node_base\fP * \fB_M_erase_after\fP (\fB_Fwd_list_node_base\fP *__pos)" .br .ti -1c .RI "\fB_Fwd_list_node_base\fP * \fB_M_erase_after\fP (\fB_Fwd_list_node_base\fP *__pos, \fB_Fwd_list_node_base\fP *__last)" .br .ti -1c .RI "\fB_Node\fP * \fB_M_get_node\fP ()" .br .ti -1c .RI "_Node_alloc_type & \fB_M_get_Node_allocator\fP () noexcept" .br .ti -1c .RI "const _Node_alloc_type & \fB_M_get_Node_allocator\fP () const noexcept" .br .ti -1c .RI "template \fB_Fwd_list_node_base\fP * \fB_M_insert_after\fP (\fBconst_iterator\fP __pos, _Args &&\&.\&.\&.__args)" .br .ti -1c .RI "void \fB_M_put_node\fP (\fB_Node\fP *__p)" .br .in -1c .SS "Private Attributes" .in +1c .ti -1c .RI "_Fwd_list_impl \fB_M_impl\fP" .br .in -1c .SH "Detailed Description" .PP .SS "template>class std::forward_list< _Tp, _Alloc >" A standard container with linear time access to elements, and fixed time insertion/deletion at any point in the sequence\&. Meets the requirements of a \fCcontainer\fP, a \fCsequence\fP, including the \fCoptional sequence requirements\fP with the exception of \fCat\fP and \fCoperator\fP[]\&. .PP This is a \fIsingly\fP \fIlinked\fP list\&. Traversal up the list requires linear time, but adding and removing elements (or \fInodes\fP) is done in constant time, regardless of where the change takes place\&. Unlike \fBstd::vector\fP and \fBstd::deque\fP, random-access iterators are not provided, so subscripting ( \fC\fP[] ) access is not allowed\&. For algorithms which only need sequential access, this lack makes no difference\&. .PP Also unlike the other standard containers, \fBstd::forward_list\fP provides specialized algorithms unique to linked lists, such as splicing, sorting, and in-place reversal\&. .PP A couple points on memory allocation for forward_list: .PP First, we never actually allocate a Tp, we allocate Fwd_list_node's and trust [20\&.1\&.5]/4 to DTRT\&. This is to ensure that after elements from forward_list are spliced into forward_list, destroying the memory of the second list is a valid operation, i\&.e\&., Alloc1 giveth and Alloc2 taketh away\&. .PP Definition at line 405 of file forward_list\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (const _Alloc &__al = \fC_Alloc()\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP Creates a forward_list with no elements\&. \fBParameters:\fP .RS 4 \fI__al\fP An allocator object\&. .RE .PP .PP Definition at line 435 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (const \fBforward_list\fP< _Tp, _Alloc > &__list, const _Alloc &__al)\fC [inline]\fP" .PP Copy constructor with allocator argument\&. \fBParameters:\fP .RS 4 \fI__list\fP Input list to copy\&. .br \fI__al\fP An allocator object\&. .RE .PP .PP Definition at line 444 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (\fBforward_list\fP< _Tp, _Alloc > &&__list, const _Alloc &__al)\fC [inline]\fP" .PP Move constructor with allocator argument\&. \fBParameters:\fP .RS 4 \fI__list\fP Input list to move\&. .br \fI__al\fP An allocator object\&. .RE .PP .PP Definition at line 453 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (size_type__n)\fC [inline]\fP, \fC [explicit]\fP" .PP Creates a forward_list with default constructed elements\&. \fBParameters:\fP .RS 4 \fI__n\fP The number of elements to initially create\&. .RE .PP This constructor creates the forward_list with \fI__n\fP default constructed elements\&. .PP Definition at line 465 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (size_type__n, const _Tp &__value, const _Alloc &__al = \fC_Alloc()\fP)\fC [inline]\fP" .PP Creates a forward_list with copies of an exemplar element\&. \fBParameters:\fP .RS 4 \fI__n\fP The number of elements to initially create\&. .br \fI__value\fP An element to copy\&. .br \fI__al\fP An allocator object\&. .RE .PP This constructor fills the forward_list with \fI__n\fP copies of \fI__value\fP\&. .PP Definition at line 478 of file forward_list\&.h\&. .SS "template> template \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (_InputIterator__first, _InputIterator__last, const _Alloc &__al = \fC_Alloc()\fP)\fC [inline]\fP" .PP Builds a forward_list from a range\&. \fBParameters:\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .br \fI__al\fP An allocator object\&. .RE .PP Create a forward_list consisting of copies of the elements from [\fI__first\fP,\fI__last\fP)\&. This is linear in N (where N is distance(\fI__first\fP,\fI__last\fP))\&. .PP Definition at line 494 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (const \fBforward_list\fP< _Tp, _Alloc > &__list)\fC [inline]\fP" .PP The forward_list copy constructor\&. \fBParameters:\fP .RS 4 \fI__list\fP A forward_list of identical element and allocator types\&. .RE .PP The newly-created forward_list uses a copy of the allocation object used by \fI__list\fP\&. .PP Definition at line 511 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::begin(), and std::forward_list< _Tp, _Alloc >::end()\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (\fBforward_list\fP< _Tp, _Alloc > &&__list)\fC [inline]\fP, \fC [noexcept]\fP" .PP The forward_list move constructor\&. \fBParameters:\fP .RS 4 \fI__list\fP A forward_list of identical element and allocator types\&. .RE .PP The newly-created forward_list contains the exact contents of \fI\fBforward_list\fP\fP\&. The contents of \fI__list\fP are a valid, but unspecified forward_list\&. .PP Definition at line 524 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (\fBstd::initializer_list\fP< _Tp >__il, const _Alloc &__al = \fC_Alloc()\fP)\fC [inline]\fP" .PP Builds a forward_list from an \fBinitializer_list\fP\&. \fBParameters:\fP .RS 4 \fI__il\fP An \fBinitializer_list\fP of value_type\&. .br \fI__al\fP An allocator object\&. .RE .PP Create a forward_list consisting of copies of the elements in the \fBinitializer_list\fP \fI__il\fP\&. This is linear in \fB__il\&.size()\fP\&. .PP Definition at line 535 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::~\fBforward_list\fP ()\fC [inline]\fP, \fC [noexcept]\fP" .PP The \fBforward_list\fP dtor\&. .PP Definition at line 543 of file forward_list\&.h\&. .SH "Member Function Documentation" .PP .SS "template> template void \fBstd::forward_list\fP< _Tp, _Alloc >::assign (_InputIterator__first, _InputIterator__last)\fC [inline]\fP" .PP Assigns a range to a forward_list\&. \fBParameters:\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .RE .PP This function fills a forward_list with copies of the elements in the range [\fI__first\fP,\fI__last\fP)\&. .PP Note that the assignment completely changes the forward_list and that the number of elements of the resulting forward_list's is the same as the number of elements assigned\&. Old data is lost\&. .PP Definition at line 605 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::cbefore_begin(), std::forward_list< _Tp, _Alloc >::clear(), and std::forward_list< _Tp, _Alloc >::insert_after()\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::operator=()\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::assign (size_type__n, const _Tp &__val)\fC [inline]\fP" .PP Assigns a given value to a forward_list\&. \fBParameters:\fP .RS 4 \fI__n\fP Number of elements to be assigned\&. .br \fI__val\fP Value to be assigned\&. .RE .PP This function fills a forward_list with \fI__n\fP copies of the given value\&. Note that the assignment completely changes the forward_list, and that the resulting forward_list has __n elements\&. Old data is lost\&. .PP Definition at line 622 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::cbefore_begin(), std::forward_list< _Tp, _Alloc >::clear(), and std::forward_list< _Tp, _Alloc >::insert_after()\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::assign (\fBstd::initializer_list\fP< _Tp >__il)\fC [inline]\fP" .PP Assigns an \fBinitializer_list\fP to a forward_list\&. \fBParameters:\fP .RS 4 \fI__il\fP An \fBinitializer_list\fP of value_type\&. .RE .PP Replace the contents of the forward_list with copies of the elements in the \fBinitializer_list\fP \fI__il\fP\&. This is linear in \fBil\&.size()\fP\&. .PP Definition at line 637 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::cbefore_begin(), std::forward_list< _Tp, _Alloc >::clear(), and std::forward_list< _Tp, _Alloc >::insert_after()\&. .SS "template> \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::before_begin ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write iterator that points before the first element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 655 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::insert_after()\&. .SS "template> \fBconst_iterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::before_begin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points before the first element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 664 of file forward_list\&.h\&. .SS "template> \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::begin ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write iterator that points to the first element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 672 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::forward_list()\&. .SS "template> \fBconst_iterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::begin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 681 of file forward_list\&.h\&. .SS "template> \fBconst_iterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::cbefore_begin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points before the first element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 717 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::assign(), std::forward_list< _Tp, _Alloc >::emplace_front(), and std::forward_list< _Tp, _Alloc >::push_front()\&. .SS "template> \fBconst_iterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::cbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 708 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::operator=(), and std::operator==()\&. .SS "template> \fBconst_iterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::cend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points one past the last element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 726 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::operator=(), and std::operator==()\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::clear ()\fC [inline]\fP, \fC [noexcept]\fP" .PP 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 responsibility\&. .PP Definition at line 1023 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::assign(), and std::forward_list< _Tp, _Alloc >::operator=()\&. .SS "template> template \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::emplace_after (\fBconst_iterator\fP__pos, _Args &&\&.\&.\&.__args)\fC [inline]\fP" .PP Constructs object in forward_list after the specified iterator\&. \fBParameters:\fP .RS 4 \fI__pos\fP A const_iterator into the forward_list\&. .br \fI__args\fP Arguments\&. .RE .PP \fBReturns:\fP .RS 4 An iterator that points to the inserted data\&. .RE .PP This function will insert an object of type T constructed with T(std::forward(args)\&.\&.\&.) after the specified location\&. Due to the nature of a forward_list this operation can be done in constant time, and does not invalidate iterators and references\&. .PP Definition at line 839 of file forward_list\&.h\&. .SS "template> template void \fBstd::forward_list\fP< _Tp, _Alloc >::emplace_front (_Args &&\&.\&.\&.__args)\fC [inline]\fP" .PP Constructs object in forward_list at the front of the list\&. \fBParameters:\fP .RS 4 \fI__args\fP Arguments\&. .RE .PP This function will insert an object of type Tp constructed with Tp(std::forward(args)\&.\&.\&.) at the front of the list Due to the nature of a forward_list this operation can be done in constant time, and does not invalidate iterators and references\&. .PP Definition at line 783 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::cbefore_begin()\&. .SS "template> bool \fBstd::forward_list\fP< _Tp, _Alloc >::empty () const\fC [inline]\fP, \fC [noexcept]\fP" Returns true if the forward_list is empty\&. (Thus \fBbegin()\fP would equal \fBend()\fP\&.) .PP Definition at line 734 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::insert_after()\&. .SS "template> \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::end ()\fC [inline]\fP, \fC [noexcept]\fP" Returns a read/write iterator that points one past the last element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 690 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::forward_list(), and std::forward_list< _Tp, _Alloc >::insert_after()\&. .SS "template> \fBconst_iterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::end () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only iterator that points one past the last element in the forward_list\&. Iteration is done in ordinary element order\&. .PP Definition at line 699 of file forward_list\&.h\&. .SS "template> \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::erase_after (\fBconst_iterator\fP__pos)\fC [inline]\fP" .PP Removes the element pointed to by the iterator following \fCpos\fP\&. \fBParameters:\fP .RS 4 \fI__pos\fP Iterator pointing before element to be erased\&. .RE .PP \fBReturns:\fP .RS 4 An iterator pointing to the element following the one that was erased, or \fBend()\fP if no such element exists\&. .RE .PP This function will erase the element at the given position and thus shorten the forward_list by one\&. .PP Due to the nature of a forward_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 responsibility\&. .PP Definition at line 941 of file forward_list\&.h\&. .SS "template> \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::erase_after (\fBconst_iterator\fP__pos, \fBconst_iterator\fP__last)\fC [inline]\fP" .PP Remove a range of elements\&. \fBParameters:\fP .RS 4 \fI__pos\fP Iterator pointing before the first element to be erased\&. .br \fI__last\fP Iterator pointing to one past the last element to be erased\&. .RE .PP \fBReturns:\fP .RS 4 @ __last\&. .RE .PP This function will erase the elements in the range \fI\fP(\fBpos,\fPlast) and shorten the forward_list accordingly\&. .PP This operation is linear time in the size of the range 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 responsibility\&. .PP Definition at line 964 of file forward_list\&.h\&. .SS "template> reference \fBstd::forward_list\fP< _Tp, _Alloc >::front ()\fC [inline]\fP" Returns a read/write reference to the data at the first element of the forward_list\&. .PP Definition at line 751 of file forward_list\&.h\&. .SS "template> const_reference \fBstd::forward_list\fP< _Tp, _Alloc >::front () const\fC [inline]\fP" Returns a read-only (constant) reference to the data at the first element of the forward_list\&. .PP Definition at line 762 of file forward_list\&.h\&. .SS "template> allocator_type \fBstd::forward_list\fP< _Tp, _Alloc >::get_allocator () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Get a copy of the memory allocation object\&. .PP Definition at line 645 of file forward_list\&.h\&. .SS "template> \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::insert_after (\fBconst_iterator\fP__pos, const _Tp &__val)\fC [inline]\fP" .PP Inserts given value into forward_list after specified iterator\&. \fBParameters:\fP .RS 4 \fI__pos\fP An iterator into the forward_list\&. .br \fI__val\fP Data to be inserted\&. .RE .PP \fBReturns:\fP .RS 4 An iterator that points to the inserted data\&. .RE .PP This function will insert a copy of the given value after the specified location\&. Due to the nature of a forward_list this operation can be done in constant time, and does not invalidate iterators and references\&. .PP Definition at line 856 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::assign()\&. .SS "template \fBforward_list\fP< _Tp, _Alloc >::\fBiterator\fP forward_list::insert_after (\fBconst_iterator\fP__pos, size_type__n, const _Tp &__val)" .PP Inserts a number of copies of given data into the forward_list\&. \fBParameters:\fP .RS 4 \fI__pos\fP An iterator into the forward_list\&. .br \fI__n\fP Number of elements to be inserted\&. .br \fI__val\fP Data to be inserted\&. .RE .PP \fBReturns:\fP .RS 4 An iterator pointing to the last inserted copy of \fIval\fP or \fIpos\fP if \fIn\fP == 0\&. .RE .PP This function will insert a specified number of copies of the given data after the location specified by \fIpos\fP\&. .PP This operation is linear in the number of elements inserted and does not invalidate iterators and references\&. .PP Definition at line 264 of file forward_list\&.tcc\&. .PP References std::forward_list< _Tp, _Alloc >::before_begin(), and std::forward_list< _Tp, _Alloc >::end()\&. .SS "template template \fBforward_list\fP< _Tp, _Alloc >::\fBiterator\fP forward_list::insert_after (\fBconst_iterator\fP__pos, _InputIterator__first, _InputIterator__last)" .PP Inserts a range into the forward_list\&. \fBParameters:\fP .RS 4 \fI__pos\fP An iterator into the forward_list\&. .br \fI__first\fP An input iterator\&. .br \fI__last\fP An input iterator\&. .RE .PP \fBReturns:\fP .RS 4 An iterator pointing to the last inserted element or \fI__pos\fP if \fI__first\fP == \fI__last\fP\&. .RE .PP This function will insert copies of the data in the range [\fI__first\fP,\fI__last\fP) into the forward_list after the location specified by \fI__pos\fP\&. .PP This operation is linear in the number of elements inserted and does not invalidate iterators and references\&. .PP Definition at line 279 of file forward_list\&.tcc\&. .PP References std::forward_list< _Tp, _Alloc >::before_begin(), std::forward_list< _Tp, _Alloc >::empty(), and std::forward_list< _Tp, _Alloc >::end()\&. .SS "template> \fBiterator\fP \fBstd::forward_list\fP< _Tp, _Alloc >::insert_after (\fBconst_iterator\fP__pos, \fBstd::initializer_list\fP< _Tp >__il)\fC [inline]\fP" .PP Inserts the contents of an \fBinitializer_list\fP into forward_list after the specified iterator\&. \fBParameters:\fP .RS 4 \fI__pos\fP An iterator into the forward_list\&. .br \fI__il\fP An \fBinitializer_list\fP of value_type\&. .RE .PP \fBReturns:\fP .RS 4 An iterator pointing to the last inserted element or \fI__pos\fP if \fI__il\fP is empty\&. .RE .PP This function will insert copies of the data in the \fBinitializer_list\fP \fI__il\fP into the forward_list before the location specified by \fI__pos\fP\&. .PP This operation is linear in the number of elements inserted and does not invalidate iterators and references\&. .PP Definition at line 920 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::insert_after()\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::insert_after()\&. .SS "template> size_type \fBstd::forward_list\fP< _Tp, _Alloc >::max_size () const\fC [inline]\fP, \fC [noexcept]\fP" Returns the largest possible number of elements of forward_list\&. .PP Definition at line 741 of file forward_list\&.h\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::merge (\fBforward_list\fP< _Tp, _Alloc > &&__list)\fC [inline]\fP" .PP Merge sorted lists\&. \fBParameters:\fP .RS 4 \fI__list\fP Sorted list to merge\&. .RE .PP Assumes that both \fIlist\fP and this list are sorted according to operator<()\&. Merges elements of \fI__list\fP into this list in sorted order, leaving \fI__list\fP empty when complete\&. Elements in this list precede elements in \fI__list\fP that are equal\&. .PP Definition at line 1161 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::merge()\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::merge()\&. .SS "template template void forward_list::merge (\fBforward_list\fP< _Tp, _Alloc > &&__list, _Comp__comp)" .PP Merge sorted lists according to comparison function\&. \fBParameters:\fP .RS 4 \fI__list\fP Sorted list to merge\&. .br \fI__comp\fP Comparison function defining sort order\&. .RE .PP Assumes that both \fI__list\fP and this list are sorted according to comp\&. Merges elements of \fI__list\fP into this list in sorted order, leaving \fI__list\fP empty when complete\&. Elements in this list precede elements in \fI__list\fP that are equivalent according to comp()\&. .PP Definition at line 358 of file forward_list\&.tcc\&. .SS "template \fBforward_list\fP< _Tp, _Alloc > & forward_list::operator= (const \fBforward_list\fP< _Tp, _Alloc > &__list)" .PP The forward_list assignment operator\&. \fBParameters:\fP .RS 4 \fI__list\fP A forward_list of identical element and allocator types\&. .RE .PP All the elements of \fI__list\fP are copied, but unlike the copy constructor, the allocator object is not copied\&. .PP Definition at line 145 of file forward_list\&.tcc\&. .PP References std::begin(), std::forward_list< _Tp, _Alloc >::cbegin(), std::forward_list< _Tp, _Alloc >::cend(), and std::end()\&. .SS "template> \fBforward_list\fP& \fBstd::forward_list\fP< _Tp, _Alloc >::operator= (\fBforward_list\fP< _Tp, _Alloc > &&__list)\fC [inline]\fP" .PP The forward_list move assignment operator\&. \fBParameters:\fP .RS 4 \fI__list\fP A forward_list of identical element and allocator types\&. .RE .PP The contents of \fI__list\fP are moved into this forward_list (without copying)\&. \fI__list\fP is a valid, but unspecified forward_list .PP Definition at line 567 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::clear(), and std::forward_list< _Tp, _Alloc >::swap()\&. .SS "template> \fBforward_list\fP& \fBstd::forward_list\fP< _Tp, _Alloc >::operator= (\fBstd::initializer_list\fP< _Tp >__il)\fC [inline]\fP" .PP The forward_list initializer list assignment operator\&. \fBParameters:\fP .RS 4 \fI__il\fP An \fBinitializer_list\fP of value_type\&. .RE .PP Replace the contents of the forward_list with copies of the elements in the \fBinitializer_list\fP \fI__il\fP\&. This is linear in \fB__il\&.size()\fP\&. .PP Definition at line 585 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::assign()\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::pop_front ()\fC [inline]\fP" .PP Removes first element\&. This is a typical stack operation\&. It shrinks the forward_list by one\&. Due to the nature of a forward_list this operation can be done in constant time, and only invalidates iterators/references to the element being removed\&. .PP Note that no data is returned, and if the first element's data is needed, it should be retrieved before \fBpop_front()\fP is called\&. .PP Definition at line 821 of file forward_list\&.h\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::push_front (const _Tp &__val)\fC [inline]\fP" .PP Add data to the front of the forward_list\&. \fBParameters:\fP .RS 4 \fI__val\fP Data to be added\&. .RE .PP This is a typical stack operation\&. The function creates an element at the front of the forward_list and assigns the given data to it\&. Due to the nature of a forward_list this operation can be done in constant time, and does not invalidate iterators and references\&. .PP Definition at line 798 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::cbefore_begin()\&. .SS "template void forward_list::remove (const _Tp &__val)" .PP Remove all elements equal to value\&. \fBParameters:\fP .RS 4 \fI__val\fP The value to remove\&. .RE .PP Removes every element in the list equal to \fI__val\fP\&. 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 responsibility\&. .PP Definition at line 292 of file forward_list\&.tcc\&. .PP References std::__addressof()\&. .SS "template template void forward_list::remove_if (_Pred__pred)" .PP Remove all elements satisfying a predicate\&. \fBParameters:\fP .RS 4 \fI__pred\fP Unary predicate function or object\&. .RE .PP 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 responsibility\&. .PP Definition at line 321 of file forward_list\&.tcc\&. .SS "template void forward_list::resize (size_type__sz)" .PP Resizes the forward_list to the specified number of elements\&. \fBParameters:\fP .RS 4 \fI__sz\fP Number of elements the forward_list should contain\&. .RE .PP This function will resize the forward_list to the specified number of elements\&. If the number is smaller than the forward_list's current number of elements the forward_list is truncated, otherwise the forward_list is extended and the new elements are default constructed\&. .PP Definition at line 190 of file forward_list\&.tcc\&. .PP References std::end()\&. .SS "template void forward_list::resize (size_type__sz, const value_type &__val)" .PP Resizes the forward_list to the specified number of elements\&. \fBParameters:\fP .RS 4 \fI__sz\fP Number of elements the forward_list should contain\&. .br \fI__val\fP Data with which new elements should be populated\&. .RE .PP This function will resize the forward_list to the specified number of elements\&. If the number is smaller than the forward_list's current number of elements the forward_list is truncated, otherwise the forward_list is extended and new elements are populated with given data\&. .PP Definition at line 209 of file forward_list\&.tcc\&. .PP References std::end()\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::reverse ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Reverse the elements in list\&. Reverse the order of elements in the list in linear time\&. .PP Definition at line 1214 of file forward_list\&.h\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::sort ()\fC [inline]\fP" .PP Sort the elements of the list\&. Sorts the elements of this list in NlogN time\&. Equivalent elements remain in list order\&. .PP Definition at line 1195 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::sort()\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::sort()\&. .SS "template template void forward_list::sort (_Comp__comp)" .PP Sort the \fBforward_list\fP using a comparison function\&. Sorts the elements of this list in NlogN time\&. Equivalent elements remain in list order\&. .PP Definition at line 404 of file forward_list\&.tcc\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::splice_after (\fBconst_iterator\fP__pos, \fBforward_list\fP< _Tp, _Alloc > &&__list)\fC [inline]\fP" .PP Insert contents of another forward_list\&. \fBParameters:\fP .RS 4 \fI__pos\fP Iterator referencing the element to insert after\&. .br \fI__list\fP Source list\&. .RE .PP The elements of \fIlist\fP are inserted in constant time after the element referenced by \fIpos\fP\&. \fIlist\fP becomes an empty list\&. .PP Requires this != \fIx\fP\&. .PP Definition at line 1040 of file forward_list\&.h\&. .SS "template void forward_list::splice_after (\fBconst_iterator\fP__pos, \fBforward_list\fP< _Tp, _Alloc > &&__list, \fBconst_iterator\fP__i)" .PP Insert element from another forward_list\&. \fBParameters:\fP .RS 4 \fI__pos\fP Iterator referencing the element to insert after\&. .br \fI__list\fP Source list\&. .br \fI__i\fP Iterator referencing the element before the element to move\&. .RE .PP Removes the element in list \fIlist\fP referenced by \fIi\fP and inserts it into the current list after \fIpos\fP\&. .PP Definition at line 247 of file forward_list\&.tcc\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::splice_after (\fBconst_iterator\fP__pos, \fBforward_list\fP< _Tp, _Alloc > &&, \fBconst_iterator\fP__before, \fBconst_iterator\fP__last)\fC [inline]\fP" .PP Insert range from another forward_list\&. \fBParameters:\fP .RS 4 \fI__pos\fP Iterator referencing the element to insert after\&. .br \fI__list\fP Source list\&. .br \fI__before\fP Iterator referencing before the start of range in list\&. .br \fI__last\fP Iterator referencing the end of range in list\&. .RE .PP Removes elements in the range (\fBbefore,\fPlast) and inserts them after \fI__pos\fP in constant time\&. .PP Undefined if \fI\fBpos\fP is in (__before,\fPlast)\&. .PP Definition at line 1083 of file forward_list\&.h\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::swap (\fBforward_list\fP< _Tp, _Alloc > &__list)\fC [inline]\fP" .PP Swaps data with another forward_list\&. \fBParameters:\fP .RS 4 \fI__list\fP A forward_list of the same element and allocator types\&. .RE .PP 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\&. .PP Definition at line 981 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::operator=(), and std::swap()\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::unique ()\fC [inline]\fP" .PP 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 responsibility\&. .PP Definition at line 1132 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::unique()\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::unique()\&. .SS "template template void forward_list::unique (_BinPred__binary_pred)" .PP Remove consecutive elements satisfying a predicate\&. \fBParameters:\fP .RS 4 \fI__binary_pred\fP Binary predicate function or object\&. .RE .PP 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 responsibility\&. .PP Definition at line 337 of file forward_list\&.tcc\&. .PP References std::begin(), and std::end()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.