.TH "std::forward_list< _Tp, _Alloc >" 3cxx "Tue Feb 2 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME 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\&. .SH SYNOPSIS .br .PP .PP Inherits \fBstd::_Fwd_list_base< _Tp, allocator< _Tp > >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .ti -1c .RI "typedef \fB_Fwd_list_const_iterator\fP< _Tp > \fBconst_iterator\fP" .br .ti -1c .RI "typedef \fB_Alloc_traits::const_pointer\fP \fBconst_pointer\fP" .br .ti -1c .RI "typedef const value_type & \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 \fB_Alloc_traits::pointer\fP \fBpointer\fP" .br .ti -1c .RI "typedef value_type & \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 ()=default" .br .RI "Creates a forward_list with no elements\&. " .ti -1c .RI "template> \fBforward_list\fP (_InputIterator __first, _InputIterator __last, const _Alloc &__al=_Alloc())" .br .RI "Builds a forward_list from a range\&. " .ti -1c .RI "\fBforward_list\fP (const _Alloc &__al) noexcept" .br .RI "Creates a forward_list with no elements\&. " .ti -1c .RI "\fBforward_list\fP (const \fBforward_list\fP &__list)" .br .RI "The forward_list copy constructor\&. " .ti -1c .RI "\fBforward_list\fP (const \fBforward_list\fP &__list, const _Alloc &__al)" .br .RI "Copy constructor with allocator argument\&. " .ti -1c .RI "\fBforward_list\fP (\fBforward_list\fP &&)=default" .br .RI "The forward_list move constructor\&. " .ti -1c .RI "\fBforward_list\fP (\fBforward_list\fP &&__list, const _Alloc &__al) noexcept(_Node_alloc_traits::_S_always_equal())" .br .RI "Move constructor with allocator argument\&. " .ti -1c .RI "\fBforward_list\fP (size_type __n, const _Alloc &__al=_Alloc())" .br .RI "Creates a forward_list with default constructed elements\&. " .ti -1c .RI "\fBforward_list\fP (size_type __n, const _Tp &__value, const _Alloc &__al=_Alloc())" .br .RI "Creates a forward_list with copies of an exemplar element\&. " .ti -1c .RI "\fBforward_list\fP (\fBstd::initializer_list\fP< _Tp > __il, const _Alloc &__al=_Alloc())" .br .RI "Builds a forward_list from an initializer_list\&. " .ti -1c .RI "\fB~forward_list\fP () noexcept" .br .RI "The forward_list dtor\&. " .ti -1c .RI "template> void \fBassign\fP (_InputIterator __first, _InputIterator __last)" .br .RI "Assigns a range to a forward_list\&. " .ti -1c .RI "void \fBassign\fP (size_type __n, const _Tp &__val)" .br .RI "Assigns a given value to a forward_list\&. " .ti -1c .RI "void \fBassign\fP (\fBstd::initializer_list\fP< _Tp > __il)" .br .RI "Assigns an initializer_list to a forward_list\&. " .ti -1c .RI "\fBconst_iterator\fP \fBbefore_begin\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBbefore_begin\fP () noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBbegin\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBbegin\fP () 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 .RI "Erases all the elements\&. " .ti -1c .RI "template \fBiterator\fP \fBemplace_after\fP (\fBconst_iterator\fP __pos, _Args &&\&.\&.\&. __args)" .br .RI "Constructs object in forward_list after the specified iterator\&. " .ti -1c .RI "template void \fBemplace_front\fP (_Args &&\&.\&.\&. __args)" .br .RI "Constructs object in forward_list at the front of the list\&. " .ti -1c .RI "bool \fBempty\fP () const noexcept" .br .ti -1c .RI "\fBconst_iterator\fP \fBend\fP () const noexcept" .br .ti -1c .RI "\fBiterator\fP \fBend\fP () noexcept" .br .ti -1c .RI "\fBiterator\fP \fBerase_after\fP (\fBconst_iterator\fP __pos)" .br .RI "Removes the element pointed to by the iterator following \fCpos\fP\&. " .ti -1c .RI "\fBiterator\fP \fBerase_after\fP (\fBconst_iterator\fP __pos, \fBconst_iterator\fP __last)" .br .RI "Remove a range of elements\&. " .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 .RI "Get a copy of the memory allocation object\&. " .ti -1c .RI "template> \fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, _InputIterator __first, _InputIterator __last)" .br .RI "Inserts a range into the forward_list\&. " .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, const _Tp &__val)" .br .RI "Inserts given value into forward_list after specified iterator\&. " .ti -1c .RI "\fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, size_type __n, const _Tp &__val)" .br .RI "Inserts a number of copies of given data into the forward_list\&. " .ti -1c .RI "\fBiterator\fP \fBinsert_after\fP (\fBconst_iterator\fP __pos, \fBstd::initializer_list\fP< _Tp > __il)" .br .RI "Inserts the contents of an initializer_list into forward_list after the specified iterator\&. " .ti -1c .RI "size_type \fBmax_size\fP () const noexcept" .br .ti -1c .RI "\fBforward_list\fP & \fBoperator=\fP (const \fBforward_list\fP &__list)" .br .RI "The forward_list assignment operator\&. " .ti -1c .RI "\fBforward_list\fP & \fBoperator=\fP (\fBforward_list\fP &&__list) noexcept(_Node_alloc_traits::_S_nothrow_move())" .br .RI "The forward_list move assignment operator\&. " .ti -1c .RI "\fBforward_list\fP & \fBoperator=\fP (\fBstd::initializer_list\fP< _Tp > __il)" .br .RI "The forward_list initializer list assignment operator\&. " .ti -1c .RI "void \fBpop_front\fP ()" .br .RI "Removes first element\&. " .ti -1c .RI "void \fBpush_front\fP (_Tp &&__val)" .br .ti -1c .RI "void \fBpush_front\fP (const _Tp &__val)" .br .RI "Add data to the front of the forward_list\&. " .ti -1c .RI "void \fBresize\fP (size_type __sz)" .br .RI "Resizes the forward_list to the specified number of elements\&. " .ti -1c .RI "void \fBresize\fP (size_type __sz, const value_type &__val)" .br .RI "Resizes the forward_list to the specified number of elements\&. " .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &&__list) noexcept" .br .RI "Insert contents of another forward_list\&. " .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &&__list, \fBconst_iterator\fP __i) noexcept" .br .RI "Insert element from another forward_list\&. " .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &__list) noexcept" .br .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &__list, \fBconst_iterator\fP __i) noexcept" .br .ti -1c .RI "void \fBswap\fP (\fBforward_list\fP &__list) noexcept" .br .RI "Swaps data with another forward_list\&. " .in -1c .in +1c .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &&, \fBconst_iterator\fP __before, \fBconst_iterator\fP __last) noexcept" .br .RI "Insert range from another forward_list\&. " .ti -1c .RI "void \fBsplice_after\fP (\fBconst_iterator\fP __pos, \fBforward_list\fP &, \fBconst_iterator\fP __before, \fBconst_iterator\fP __last) noexcept" .br .RI "Insert range from another forward_list\&. " .ti -1c .RI "void \fBremove\fP (const _Tp &__val)" .br .RI "Remove all elements equal to value\&. " .ti -1c .RI "template void \fBremove_if\fP (_Pred __pred)" .br .RI "Remove all elements satisfying a predicate\&. " .ti -1c .RI "void \fBunique\fP ()" .br .RI "Remove consecutive duplicate elements\&. " .ti -1c .RI "template void \fBunique\fP (_BinPred __binary_pred)" .br .RI "Remove consecutive elements satisfying a predicate\&. " .ti -1c .RI "void \fBmerge\fP (\fBforward_list\fP &&__list)" .br .RI "Merge sorted lists\&. " .ti -1c .RI "void \fBmerge\fP (\fBforward_list\fP &__list)" .br .RI "Insert range from another forward_list\&. " .ti -1c .RI "template void \fBmerge\fP (\fBforward_list\fP &&__list, _Comp __comp)" .br .RI "Merge sorted lists according to comparison function\&. " .ti -1c .RI "template void \fBmerge\fP (\fBforward_list\fP &__list, _Comp __comp)" .br .RI "Insert range from another forward_list\&. " .ti -1c .RI "void \fBsort\fP ()" .br .RI "Sort the elements of the list\&. " .ti -1c .RI "template void \fBsort\fP (_Comp __comp)" .br .RI "Sort the forward_list using a comparison function\&. " .ti -1c .RI "void \fBreverse\fP () noexcept" .br .RI "Reverse the elements in list\&. " .in -1c .SH "Detailed Description" .PP .SS "template> .br 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\&. .PP \fBTemplate Parameters\fP .RS 4 \fI_Tp\fP Type of element\&. .br \fI_Alloc\fP Allocator type, defaults to allocator<_Tp>\&. .RE .PP 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 std::vector and std::deque, 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, std::forward_list provides specialized algorithms unique to linked lists, such as splicing, sorting, and in-place reversal\&. .PP Definition at line 425 of file forward_list\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP ()\fC [default]\fP" .PP Creates a forward_list with no elements\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (const _Alloc & __al)\fC [inline]\fP, \fC [explicit]\fP, \fC [noexcept]\fP" .PP Creates a forward_list with no elements\&. .PP \fBParameters\fP .RS 4 \fI__al\fP An allocator object\&. .RE .PP .PP Definition at line 468 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\&. .PP \fBParameters\fP .RS 4 \fI__list\fP Input list to copy\&. .br \fI__al\fP An allocator object\&. .RE .PP .PP Definition at line 477 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, const _Alloc & __al)\fC [inline]\fP, \fC [noexcept]\fP" .PP Move constructor with allocator argument\&. .PP \fBParameters\fP .RS 4 \fI__list\fP Input list to move\&. .br \fI__al\fP An allocator object\&. .RE .PP .PP Definition at line 505 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::\fBforward_list\fP (size_type __n, const _Alloc & __al = \fC_Alloc()\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP Creates a forward_list with default constructed elements\&. .PP \fBParameters\fP .RS 4 \fI__n\fP The number of elements to initially create\&. .br \fI__al\fP An allocator object\&. .RE .PP This constructor creates the forward_list with \fI__n\fP default constructed elements\&. .PP Definition at line 520 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\&. .PP \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 533 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\&. .PP \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 550 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\&. .PP \fBParameters\fP .RS 4 \fI__list\fP A forward_list of identical element and allocator types\&. .RE .PP .PP Definition at line 560 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 > &&)\fC [default]\fP" .PP The forward_list move constructor\&. .PP \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 the moved instance\&. The contents of the moved instance are a valid, but unspecified forward_list\&. .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 initializer_list\&. .PP \fBParameters\fP .RS 4 \fI__il\fP An initializer_list of value_type\&. .br \fI__al\fP An allocator object\&. .RE .PP Create a forward_list consisting of copies of the elements in the initializer_list \fI__il\fP\&. This is linear in __il\&.size()\&. .PP Definition at line 584 of file forward_list\&.h\&. .SS "template> \fBstd::forward_list\fP< _Tp, _Alloc >::~\fBforward_list\fP ()\fC [inline]\fP, \fC [noexcept]\fP" .PP The forward_list dtor\&. .PP Definition at line 592 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\&. .PP \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 is the same as the number of elements assigned\&. .PP Definition at line 660 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::assign(), and 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\&. .PP \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\&. .PP Definition at line 677 of file forward_list\&.h\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::assign (\fBstd::initializer_list\fP< _Tp > __il)\fC [inline]\fP" .PP Assigns an initializer_list to a forward_list\&. .PP \fBParameters\fP .RS 4 \fI__il\fP An initializer_list of value_type\&. .RE .PP Replace the contents of the forward_list with copies of the elements in the initializer_list \fI__il\fP\&. This is linear in il\&.size()\&. .PP Definition at line 689 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::assign()\&. .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 713 of file forward_list\&.h\&. .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 704 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 >::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 730 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 721 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 >::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 766 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::emplace_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 757 of file forward_list\&.h\&. .PP Referenced by std::operator<(), and std::forward_list< _Tp, _Alloc >::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 775 of file forward_list\&.h\&. .PP Referenced by std::operator<(), and std::forward_list< _Tp, _Alloc >::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 1088 of file forward_list\&.h\&. .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\&. .PP \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 897 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\&. .PP \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 836 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::cbefore_begin(), and std::forward_list< _Tp, _Alloc >::front()\&. .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 begin() would equal end()\&.) .PP Definition at line 783 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 >::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 748 of file forward_list\&.h\&. .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 739 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> \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\&. .PP \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 end() 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 1000 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\&. .PP \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(__pos,__last) 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 1023 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 800 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::emplace_front()\&. .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 811 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 694 of file forward_list\&.h\&. .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\&. .PP \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 270 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, const _Tp & __val)\fC [inline]\fP" .PP Inserts given value into forward_list after specified iterator\&. .PP \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 914 of file forward_list\&.h\&. .PP Referenced by std::forward_list< _Tp, _Alloc >::insert_after()\&. .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\&. .PP \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 255 of file forward_list\&.tcc\&. .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 initializer_list into forward_list after the specified iterator\&. .PP \fBParameters\fP .RS 4 \fI__pos\fP An iterator into the forward_list\&. .br \fI__il\fP An initializer_list 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 initializer_list \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 979 of file forward_list\&.h\&. .PP References 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 790 of file forward_list\&.h\&. .PP References __gnu_cxx::__alloc_traits< _Alloc, typename >::max_size()\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::merge (\fBforward_list\fP< _Tp, _Alloc > && __list)\fC [inline]\fP" .PP Merge sorted lists\&. .PP \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 1228 of file forward_list\&.h\&. .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\&. .PP \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 348 of file forward_list\&.tcc\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::merge (\fBforward_list\fP< _Tp, _Alloc > & __list)\fC [inline]\fP" .PP Insert range from another forward_list\&. .PP \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 (__before,__last) and inserts them after \fI__pos\fP in constant time\&. .PP Undefined if \fI__pos\fP is in (__before,__last)\&. .PP Definition at line 1232 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::merge()\&. .SS "template> template void \fBstd::forward_list\fP< _Tp, _Alloc >::merge (\fBforward_list\fP< _Tp, _Alloc > & __list, _Comp __comp)\fC [inline]\fP" .PP Insert range from another forward_list\&. .PP \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 (__before,__last) and inserts them after \fI__pos\fP in constant time\&. .PP Undefined if \fI__pos\fP is in (__before,__last)\&. .PP Definition at line 1252 of file forward_list\&.h\&. .PP References std::forward_list< _Tp, _Alloc >::merge()\&. .SS "template \fBforward_list\fP< _Tp, _Alloc > & forward_list::operator= (const \fBforward_list\fP< _Tp, _Alloc > & __list)" .PP The forward_list assignment operator\&. .PP \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\&. .PP Whether the allocator is copied depends on the allocator traits\&. .PP Definition at line 139 of file forward_list\&.tcc\&. .PP References std::__addressof(), std::forward_list< _Tp, _Alloc >::cbegin(), and std::forward_list< _Tp, _Alloc >::cend()\&. .SS "template> \fBforward_list\fP& \fBstd::forward_list\fP< _Tp, _Alloc >::operator= (\fBforward_list\fP< _Tp, _Alloc > && __list)\fC [inline]\fP, \fC [noexcept]\fP" .PP The forward_list move assignment operator\&. .PP \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, if the allocators permit it)\&. .PP Afterwards \fI__list\fP is a valid, but unspecified forward_list .PP Whether the allocator is moved depends on the allocator traits\&. .PP Definition at line 620 of file forward_list\&.h\&. .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\&. .PP \fBParameters\fP .RS 4 \fI__il\fP An initializer_list of value_type\&. .RE .PP Replace the contents of the forward_list with copies of the elements in the initializer_list \fI__il\fP\&. This is linear in __il\&.size()\&. .PP Definition at line 639 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 pop_front() is called\&. .PP Definition at line 879 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\&. .PP \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 856 of file forward_list\&.h\&. .SS "template void forward_list::remove (const _Tp & __val)" .PP Remove all elements equal to value\&. .PP \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 283 of file forward_list\&.tcc\&. .SS "template template void forward_list::remove_if (_Pred __pred)" .PP Remove all elements satisfying a predicate\&. .PP \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 311 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\&. .PP \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 181 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\&. .PP \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 200 of file forward_list\&.tcc\&. .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 1281 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 1262 of file forward_list\&.h\&. .SS "template template void forward_list::sort (_Comp __comp)" .PP Sort the forward_list using a comparison function\&. Sorts the elements of this list in NlogN time\&. Equivalent elements remain in list order\&. .PP Definition at line 392 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, \fC [noexcept]\fP" .PP Insert range from another forward_list\&. .PP \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 (__before,__last) and inserts them after \fI__pos\fP in constant time\&. .PP Undefined if \fI__pos\fP is in (__before,__last)\&. .PP Definition at line 1149 of file forward_list\&.h\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::splice_after (\fBconst_iterator\fP __pos, \fBforward_list\fP< _Tp, _Alloc > && __list)\fC [inline]\fP, \fC [noexcept]\fP" .PP Insert contents of another forward_list\&. .PP \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 1105 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)\fC [noexcept]\fP" .PP Insert element from another forward_list\&. .PP \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 238 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, \fC [noexcept]\fP" .PP Insert range from another forward_list\&. .PP \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 (__before,__last) and inserts them after \fI__pos\fP in constant time\&. .PP Undefined if \fI__pos\fP is in (__before,__last)\&. .PP Definition at line 1154 of file forward_list\&.h\&. .SS "template> void \fBstd::forward_list\fP< _Tp, _Alloc >::swap (\fBforward_list\fP< _Tp, _Alloc > & __list)\fC [inline]\fP, \fC [noexcept]\fP" .PP Swaps data with another forward_list\&. .PP \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 Whether the allocators are swapped depends on the allocator traits\&. .PP Definition at line 1042 of file forward_list\&.h\&. .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 1199 of file forward_list\&.h\&. .SS "template template void forward_list::unique (_BinPred __binary_pred)" .PP Remove consecutive elements satisfying a predicate\&. .PP \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 327 of file forward_list\&.tcc\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.