std::forward_list::forward_list

(1) explicit forward_list( const Allocator& alloc = Allocator() ); (since C++11) (until C++14) forward_list() : forward_list( Allocator() ) {} explicit forward_list( const Allocator& alloc ); (since C++14) forward_list( size_type count, const T& value, const Allocator& alloc = Allocator()); (2) (since C++11) (3) explicit forward_list( size_type count ); (since C++11) (until C++14) explicit forward_list( size_type count, cons

std::forward_list::erase_after

iterator erase_after( const_iterator pos ); (1) (since C++11) iterator erase_after( const_iterator first, const_iterator last ); (2) (since C++11) Removes specified elements from the container. 1) Removes the element following pos. 2) Removes the elements in the range (first; last). Parameters pos - iterator to the element preceding the element to remove first, last - range of elements to remove Return value 1) Iterator to the element following the erased on

std::forward_list::end

iterator end(); (since C++11) const_iterator end() const; (since C++11) const_iterator cend() const; (since C++11) Returns an iterator to the element following the last element of the container. This element acts as a placeholder; attempting to access it results in undefined behavior. Parameters (none). Return value Iterator to the element following the last element. Exceptions noexcept specification: noexcept Complexity Constant. See also begin cbegin

std::forward_list::empty

bool empty() const; (since C++11) Checks if the container has no elements, i.e. whether begin() == end(). Parameters (none). Return value true if the container is empty, false otherwise. Exceptions noexcept specification: noexcept Complexity Constant. Example The following code uses empty to check if a std::forward_list<int> contains any elements: #include <forward_list> #include <iostream> int main() { std::forward_list<int> numbers;

std::forward_list::emplace_front

template< class... Args > void emplace_front( Args&&... args ); (since C++11) Inserts a new element to the beginning of the container. The element is constructed through std::allocator_traits::construct, which typically uses placement-new to construct the element in-place at the location provided by the container. The arguments args... are forwarded to the constructor as std::forward<Args>(args).... No iterators or references are invalidated. Parameters args -

std::forward_list::emplace_after

template< class... Args > iterator emplace_after( const_iterator pos, Args&&... args ); (since C++11) Inserts a new element into a position after the specified position in the container. The element is constructed in-place, i.e. no copy or move operations are performed. The constructor of the element is called with exactly the same arguments, as supplied to the function. No iterators or references are invalidated. Parameters pos - iterator after which the new elem

std::forward_list::clear

void clear(); (since C++11) Removes all elements from the container. Invalidates any references, pointers, or iterators referring to contained elements. May invalidate any past-the-end iterators. Parameters (none). Return value (none). Exceptions noexcept specification: noexcept Complexity Linear in the size of the container. clear is defined in terms of erase, which has linear complexity. (until C++11) complexity of clear is omitted (since C++11)(until C++14) clea

std::forward_list::begin

iterator begin(); (since C++11) const_iterator begin() const; (since C++11) const_iterator cbegin() const; (since C++11) Returns an iterator to the first element of the container. If the container is empty, the returned iterator will be equal to end(). Parameters (none). Return value Iterator to the first element. Exceptions noexcept specification: noexcept Complexity Constant. Example See also end cend returns an iterator to the end (public member

std::forward_list::before_begin

iterator before_begin(); (since C++11) const_iterator before_begin() const; (since C++11) const_iterator cbefore_begin() const; (since C++11) Returns an iterator to the element before the first element of the container. This element acts as a placeholder, attempting to access it results in undefined behavior. The only usage cases are in functions insert_after(), emplace_after(), erase_after(), splice_after() and the increment operator: incrementing the before-begin iterator

std::forward_list::assign

void assign( size_type count, const T& value ); (1) (since C++11) template< class InputIt > void assign( InputIt first, InputIt last ); (2) (since C++11) void assign( std::initializer_list<T> ilist ); (3) (since C++11) Replaces the contents of the container. 1) Replaces the contents with count copies of value value 2) Replaces the contents with copies of those in the range [first, last). This overload has the same effect as overload (1) if InputIt is an in