std::list::reverse

void reverse(); Reverses the order of the elements in the container. No references or iterators become invalidated. Parameters (none). Return value (none). Example #include <iostream> #include <list> std::ostream& operator<<(std::ostream& ostr, const std::list<int>& list) { for (auto &i : list) { ostr << " " << i; } return ostr; } int main() { std::list<int> list = { 8,7,5,9,0,1,3,2,6,4 };

std::list::rend

reverse_iterator rend(); const_reverse_iterator rend() const; const_reverse_iterator crend() const; (since C++11) Returns a reverse iterator to the element following the last element of the reversed container. It corresponds to the element preceding the first element of the non-reversed container. This element acts as a placeholder, attempting to access it results in undefined behavior. Parameters (none). Return value Reverse iterator to the element following the last

std::list::pop_front

void pop_front(); 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 pop_back removes the last element (public member function) push_front inserts an element to the beginning (public member function)

std::list::push_front

void push_front( const T& value ); 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 (C++11) constructs an element in-plac

std::list::remove

void remove( const T& value ); template< class UnaryPredicate > void remove_if( UnaryPredicate p ); 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 the predicate function shoul

std::list::push_back

void push_back( const T& value ); (1) void push_back( T&& value ); (2) (since C++11) Appends the given element value to the end of the container. 1) The new element is initialized as a copy of value. 2) value is moved into the new element. No iterators or references are invalidated. Parameters value - the value of the element to append Type requirements - T must meet the requirements of CopyInsertable in order to use overload (1). - T must meet the requ

std::list::pop_back

void pop_back(); Removes the last element of the container. Calling pop_back on an empty container is undefined. References and iterators to the erased element are invalidated. Parameters (none). Return value (none). Complexity Constant. Exceptions (none). See also pop_front removes the first element (public member function) push_back adds an element to the end (public member function)

std::list::rbegin

reverse_iterator rbegin(); const_reverse_iterator rbegin() const; const_reverse_iterator crbegin() const; (since C++11) Returns a reverse iterator to the first element of the reversed container. It corresponds to the last element of the non-reversed container. Parameters (none). Return value Reverse iterator to the first element. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) Complexity Constant. See also rend crend r

std::list::list

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

std::list::front

reference front(); const_reference front() const; 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::list<char>: #include <list> #include <iostream> i