std::forward_list::merge

void merge( forward_list& other ); (1) (since C++11) void merge( forward_list&& other ); (1) (since C++11) template <class Compare> void merge( forward_list& other, Compare comp ); (2) (since C++11) template <class Compare> void merge( forward_list&& other, Compare comp ); (2) (since C++11) Merges two sorted lists into one. The lists should be sorted into ascending order. No elements are copied. The container other becomes empty af

std::forward_list::pop_front

void pop_front(); (since C++11) Removes the first element of the container. References and iterators to the erased element are invalidated. Parameters (none). Return value (none). Complexity Constant. Exceptions Does not throw. See also push_front inserts an element to the beginning (public member function)

std::forward_list::remove

void remove( const T& value ); (since C++11) template< class UnaryPredicate > void remove_if( UnaryPredicate p ); (since C++11) Removes all elements satisfying specific criteria. The first version removes all elements that are equal to value, the second version removes all elements for which predicate p returns true. Parameters value - value of the elements to remove p - unary predicate which returns ​true if the element should be removed. The signature of

std::forward_list::push_front

void push_front( const T& value ); (since C++11) void push_front( T&& value ); (since C++11) Prepends the given element value to the beginning of the container. No iterators or references are invalidated. Parameters value - the value of the element to prepend Return value (none). Complexity Constant. Exceptions If an exception is thrown, this function has no effect (strong exception guarantee). See also emplace_front constructs an element in-

std::forward_list::reverse

void reverse(); (since C++11) Reverses the order of the elements in the container. No references or iterators become invalidated. Parameters (none). Return value (none). Example #include <iostream> #include <forward_list> std::ostream& operator<<(std::ostream& ostr, const std::forward_list<int>& list) { for (auto &i : list) { ostr << " " << i; } return ostr; } int main() { std::forward_list<int

std::forward_list::max_size

size_type max_size() const; (since C++11) Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container. Parameters (none). Return value Maximum number of elements. Exceptions noexcept specification: noexcept Complexity Constant. Notes This value is typically equal to std::numeric_limits<size_type>::max(), and reflects the theoretical limit on t

std::forward_list::resize

void resize( size_type count ); (1) void resize( size_type count, const value_type& value ); (2) Resizes the container to contain count elements. If the current size is greater than count, the container is reduced to its first count elements. If the current size is less than count, 1) additional default-inserted elements are appended 2) additional copies of value are appended Parameters count - new size of the container value - the value to initialize the new e

std::forward_list::insert_after

iterator insert_after( const_iterator pos, const T& value ); (1) (since C++11) iterator insert_after( const_iterator pos, T&& value ); (2) (since C++11) iterator insert_after( const_iterator pos, size_type count, const T& value ); (3) (since C++11) template< class InputIt > iterator insert_after( const_iterator pos, InputIt first, InputIt last ); (4) (since C++11) iterator insert_after( const_iterator pos, std::initializer_list<T> ilist );

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::front

reference front(); (since C++11) const_reference front() const; (since C++11) Returns a reference to the first element in the container. Calling front on an empty container is undefined. Parameters (none). Return value reference to the first element. Complexity Constant. Notes For a container c, the expression c.front() is equivalent to *c.begin(). Example The following code uses front to display the first element of a std::forward_list<char>: #include <fo