template<typename_Tp,typename_Alloc=std::allocator<_Tp>>template<typename..._Args>_Node*std::list<_Tp,_Alloc>::_M_create_node(_Args&&...__args)[inline],[protected]Parameters__args An instance of user data.
Allocates space for a new node and constructs a copy of __args in it.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>template<typename_InputIterator,typename=std::_RequireInputIter<_InputIterator>>voidstd::list<_Tp,_Alloc>::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.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::assign(initializer_list<value_type>__l)[inline]
Assigns an initializer_list to a list.
Parameters__l An initializer_list of value_type.
Replace the contents of the list with copies of the elements in the initializer_list __l. This is linear
in __l.size().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::assign(size_type__n,constvalue_type&__val)[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.
Referenced by std::list<_Tp,_Alloc>::operator=().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_referencestd::list<_Tp,_Alloc>::back()const[inline],[noexcept]
Returns a read-only (constant) reference to the data at the last element of the list.
References std::list<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>referencestd::list<_Tp,_Alloc>::back()[inline],[noexcept]
Returns a read/write reference to the data at the last element of the list.
References std::list<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::list<_Tp,_Alloc>::begin()const[inline],[noexcept]
Returns a read-only (constant) iterator that points to the first element in the list. Iteration is done
in ordinary element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::list<_Tp,_Alloc>::begin()[inline],[noexcept]
Returns a read/write iterator that points to the first element in the list. Iteration is done in ordinary
element order.
Referenced by std::list<_Tp,_Alloc>::list(), std::list<_Tp,_Alloc>::crend(), std::list<_Tp,_Alloc>::front(), std::list<_Tp,_Alloc>::front(), std::list<_Tp,_Alloc>::merge(), std::list<_Tp,_Alloc>::merge(), std::list<_Tp,_Alloc>::operator=(), std::list<_Tp,_Alloc>::pop_front(), std::list<_Tp,_Alloc>::push_front(), std::list<_Tp,_Alloc>::rend(), std::list<_Tp,_Alloc>::rend(), and
std::list<_Tp,_Alloc>::splice().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::list<_Tp,_Alloc>::cbegin()const[inline],[noexcept]
Returns a read-only (constant) iterator that points to the first element in the list. Iteration is done
in ordinary element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::list<_Tp,_Alloc>::cend()const[inline],[noexcept]
Returns a read-only (constant) iterator that points one past the last element in the list. Iteration is
done in ordinary element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::clear()[inline],[noexcept]
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.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::list<_Tp,_Alloc>::crbegin()const[inline],[noexcept]
Returns a read-only (constant) reverse iterator that points to the last element in the list. Iteration is
done in reverse element order.
References std::list<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::list<_Tp,_Alloc>::crend()const[inline],[noexcept]
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.
References std::list<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc>template<typename..._Args>list<_Tp,_Alloc>::iteratorlist::emplace(const_iterator__position,_Args&&...__args)
Constructs object in list before specified iterator.
Parameters__position A const_iterator into the list.
__args Arguments.
Returns
An iterator that points to the inserted data.
This function will insert an object of type T constructed with T(std::forward<Args>(args)...) 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.
Referenced by std::list<_Tp,_Alloc>::insert().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>boolstd::list<_Tp,_Alloc>::empty()const[inline],[noexcept]
Returns true if the list is empty. (Thus begin() would equal end().)
Referenced by std::list<_Tp,_Alloc>::splice().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_iteratorstd::list<_Tp,_Alloc>::end()const[inline],[noexcept]
Returns a read-only (constant) iterator that points one past the last element in the list. Iteration is
done in ordinary element order.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::list<_Tp,_Alloc>::end()[inline],[noexcept]
Returns a read/write iterator that points one past the last element in the list. Iteration is done in
ordinary element order.
Referenced by std::list<_Tp,_Alloc>::list(), std::list<_Tp,_Alloc>::back(), std::list<_Tp,_Alloc>::back(), std::list<_Tp,_Alloc>::crbegin(), std::list<_Tp,_Alloc>::merge(), std::list<_Tp,_Alloc>::merge(), std::list<_Tp,_Alloc>::operator=(), std::list<_Tp,_Alloc>::push_back(), std::list<_Tp,_Alloc>::rbegin(), std::list<_Tp,_Alloc>::rbegin(), and std::list<_Tp,_Alloc>::splice().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::list<_Tp,_Alloc>::erase(const_iterator__first,const_iterator__last)[inline],[noexcept]
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.
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.
References std::list<_Tp,_Alloc>::erase().
template<typename_Tp,typename_Alloc>list<_Tp,_Alloc>::iteratorlist::erase(const_iterator__position)[noexcept]
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 responsibility.
Referenced by std::list<_Tp,_Alloc>::erase().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_referencestd::list<_Tp,_Alloc>::front()const[inline],[noexcept]
Returns a read-only (constant) reference to the data at the first element of the list.
References std::list<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>referencestd::list<_Tp,_Alloc>::front()[inline],[noexcept]
Returns a read/write reference to the data at the first element of the list.
References std::list<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>allocator_typestd::list<_Tp,_Alloc>::get_allocator()const[inline],[noexcept]
Get a copy of the memory allocation object.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::list<_Tp,_Alloc>::insert(const_iterator__p,initializer_list<value_type>__l)[inline]
Inserts the contents of an initializer_list into list before specified const_iterator.
Parameters__p A const_iterator into the list.
__l An initializer_list of value_type.
Returns
An iterator pointing to the first element inserted (or __position).
This function will insert copies of the data in the initializer_list l into the list before the location
specified by p.
This operation is linear in the number of elements inserted and does not invalidate iterators and
references.
References std::list<_Tp,_Alloc>::insert().
template<typename_Tp,typename_Alloc>template<typename_InputIterator,typename>list<_Tp,_Alloc>::iteratorlist::insert(const_iterator__position,_InputIterator__first,_InputIterator__last)
Inserts a range into the list.
Parameters__position A const_iterator into the list.
__first An input iterator.
__last An input iterator.
Returns
An iterator pointing to the first element inserted (or __position).
This function will insert copies of the data in the range [first,last) into the list before the location
specified by position.
This operation is linear in the number of elements inserted and does not invalidate iterators and
references.
template<typename_Tp,typename_Alloc>list<_Tp,_Alloc>::iteratorlist::insert(const_iterator__position,constvalue_type&__x)
Inserts given value into list before specified iterator.
Parameters__position A const_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.
Referenced by std::list<_Tp,_Alloc>::insert().
template<typename_Tp,typename_Alloc>list<_Tp,_Alloc>::iteratorlist::insert(const_iterator__position,size_type__n,constvalue_type&__x)
Inserts a number of copies of given data into the list.
Parameters__position A const_iterator into the list.
__n Number of elements to be inserted.
__x Data to be inserted.
Returns
An iterator pointing to the first element inserted (or __position).
This function will insert a specified number of copies of the given data before the location specified by
position.
This operation is linear in the number of elements inserted and does not invalidate iterators and
references.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>iteratorstd::list<_Tp,_Alloc>::insert(const_iterator__position,value_type&&__x)[inline]
Inserts given rvalue into list before specified iterator.
Parameters__position A const_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 rvalue 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.
References std::list<_Tp,_Alloc>::emplace(), and std::move().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>size_typestd::list<_Tp,_Alloc>::max_size()const[inline],[noexcept]
Returns the size() of the largest possible list.
References __gnu_cxx::__alloc_traits<_Alloc,typename>::max_size().
template<typename_Tp,typename_Alloc>voidlist::merge(list<_Tp,_Alloc>&&__x)
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.
References std::__addressof(), std::list<_Tp,_Alloc>::begin(), std::begin(), std::list<_Tp,_Alloc>::end(), and std::end().
template<typename_Tp,typename_Alloc>template<typename_StrictWeakOrdering>voidlist::merge(list<_Tp,_Alloc>&&__x,_StrictWeakOrdering__comp)
Merge sorted lists according to comparison function.
TemplateParameters_StrictWeakOrdering Comparison function defining sort order.
Parameters__x Sorted list to merge.
__comp Comparison functor.
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().
References std::__addressof(), std::list<_Tp,_Alloc>::begin(), std::begin(), std::list<_Tp,_Alloc>::end(), and std::end().
template<typename_Tp,typename_Alloc>list<_Tp,_Alloc>&list::operator=(constlist<_Tp,_Alloc>&__x)
List assignment operator.
Parameters__x A list of identical element and allocator types.
All the elements of __x are copied.
Whether the allocator is copied depends on the allocator traits.
References std::__addressof(), std::list<_Tp,_Alloc>::begin(), and std::list<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>list&std::list<_Tp,_Alloc>::operator=(initializer_list<value_type>__l)[inline]
List initializer list assignment operator.
Parameters__l An initializer_list of value_type.
Replace the contents of the list with copies of the elements in the initializer_list __l. This is linear
in l.size().
References std::list<_Tp,_Alloc>::assign().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>list&std::list<_Tp,_Alloc>::operator=(list<_Tp,_Alloc>&&__x)[inline],[noexcept]
List move assignment operator.
Parameters__x A list of identical element and allocator types.
The contents of __x are moved into this list (without copying).
Afterwards __x is a valid, but unspecified list
Whether the allocator is moved depends on the allocator traits.
References std::move().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::pop_back()[inline],[noexcept]
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.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::pop_front()[inline],[noexcept]
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.
References std::list<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::push_back(constvalue_type&__x)[inline]
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.
References std::list<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::push_front(constvalue_type&__x)[inline]
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.
References std::list<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::list<_Tp,_Alloc>::rbegin()const[inline],[noexcept]
Returns a read-only (constant) reverse iterator that points to the last element in the list. Iteration is
done in reverse element order.
References std::list<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>reverse_iteratorstd::list<_Tp,_Alloc>::rbegin()[inline],[noexcept]
Returns a read/write reverse iterator that points to the last element in the list. Iteration is done in
reverse element order.
References std::list<_Tp,_Alloc>::end().
template<typename_Tp,typename_Alloc>list<_Tp,_Alloc>::__remove_return_typelist::remove(const_Tp&__value)
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 responsibility.
References std::begin(), and std::end().
template<typename_Tp,typename_Alloc>template<typename_Predicate>list<_Tp,_Alloc>::__remove_return_typelist::remove_if(_Predicate__pred)
Remove all elements satisfying a predicate.
TemplateParameters_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
responsibility.
References std::begin(), and std::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>const_reverse_iteratorstd::list<_Tp,_Alloc>::rend()const[inline],[noexcept]
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.
References std::list<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>reverse_iteratorstd::list<_Tp,_Alloc>::rend()[inline],[noexcept]
Returns a read/write reverse iterator that points to one before the first element in the list. Iteration
is done in reverse element order.
References std::list<_Tp,_Alloc>::begin().
template<typename_Tp,typename_Alloc>voidlist::resize(size_type__new_size)
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 default constructed elements are appended.
References std::end().
template<typename_Tp,typename_Alloc>voidlist::resize(size_type__new_size,constvalue_type&__x)
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.
References std::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::reverse()[inline],[noexcept]
Reverse the elements in list. Reverse the order of elements in the list in linear time.
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>size_typestd::list<_Tp,_Alloc>::size()const[inline],[noexcept]
Returns the number of elements in the list.
template<typename_Tp,typename_Alloc>voidlist::sort()
Sort the elements. Sorts the elements of this list in NlogN time. Equivalent elements remain in list
order.
References std::begin(), std::empty(), and std::end().
template<typename_Tp,typename_Alloc>template<typename_StrictWeakOrdering>voidlist::sort(_StrictWeakOrdering__comp)
Sort the elements according to comparison function. Sorts the elements of this list in NlogN time.
Equivalent elements remain in list order.
References std::begin(), std::empty(), and std::end().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::splice(const_iterator__position,list<_Tp,_Alloc>&&__x)[inline],[noexcept]
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.
Requires this != __x.
References std::list<_Tp,_Alloc>::begin(), std::list<_Tp,_Alloc>::empty(), and std::list<_Tp,_Alloc>::end().
Referenced by std::list<_Tp,_Alloc>::splice(), and std::list<_Tp,_Alloc>::splice().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::splice(const_iterator__position,list<_Tp,_Alloc>&&__x,const_iterator__first,const_iterator__last)[inline],[noexcept]
Insert range from another list.
Parameters__position Const_iterator referencing the element to insert before.
__x Source list.
__first Const_iterator referencing the start of range in x.
__last Const_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).
References std::__addressof().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::splice(const_iterator__position,list<_Tp,_Alloc>&&__x,const_iterator__i)[inline],[noexcept]
Insert element from another list.
Parameters__position Const_iterator referencing the element to insert before.
__x Source list.
__i Const_iterator referencing the element to move.
Removes the element in list __x referenced by __i and inserts it into the current list before __position.
References std::__addressof().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::splice(const_iterator__position,list<_Tp,_Alloc>&__x,const_iterator__first,const_iterator__last)[inline],[noexcept]
Insert range from another list.
Parameters__position Const_iterator referencing the element to insert before.
__x Source list.
__first Const_iterator referencing the start of range in x.
__last Const_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).
References std::move(), and std::list<_Tp,_Alloc>::splice().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::splice(const_iterator__position,list<_Tp,_Alloc>&__x,const_iterator__i)[inline],[noexcept]
Insert element from another list.
Parameters__position Const_iterator referencing the element to insert before.
__x Source list.
__i Const_iterator referencing the element to move.
Removes the element in list __x referenced by __i and inserts it into the current list before __position.
References std::move(), and std::list<_Tp,_Alloc>::splice().
template<typename_Tp,typename_Alloc=std::allocator<_Tp>>voidstd::list<_Tp,_Alloc>::swap(list<_Tp,_Alloc>&__x)[inline],[noexcept]
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.
Whether the allocators are swapped depends on the allocator traits.
template<typename_Tp,typename_Alloc>list<_Tp,_Alloc>::__remove_return_typelist::unique()
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.
References std::begin(), and std::end().
template<typename_Tp,typename_Alloc>template<typename_BinaryPredicate>list<_Tp,_Alloc>::__remove_return_typelist::unique(_BinaryPredicate__binary_pred)
Remove consecutive elements satisfying a predicate.
TemplateParameters_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 responsibility.
References std::begin(), and std::end().