None of the overloads of insert_after shall affect the validity of iterators and references, and erase_after shall invalidate only iterators and references to the erased elements. If an exception is thrown during insert_after there shall be no effect. Inserting n elements into a forward_list is linear in n, and the number of calls to the copy or move constructor of T is exactly equal to n. Erasing n elements from a forward_list is linear in n and the number of calls to the destructor of type T is exactly equal to n.
template <class... Args> reference emplace_front(Args&&... args);
Effects: Inserts an object of type value_type constructed with value_type(std::forward<Args>(args)...) at the beginning of the list.
void push_front(const T& x);
void push_front(T&& x);
void pop_front();
iterator insert_after(const_iterator position, const T& x);
iterator insert_after(const_iterator position, T&& x);
Requires: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()).
iterator insert_after(const_iterator position, size_type n, const T& x);
Requires: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()).
template <class InputIterator>
iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
Requires: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()). first and last are not iterators in *this.
iterator insert_after(const_iterator position, initializer_list<T> il);
template <class... Args>
iterator emplace_after(const_iterator position, Args&&... args);
Requires: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()).
Effects: Inserts an object of type value_type constructed with value_type(std::forward<Args>(args)...) after position.
iterator erase_after(const_iterator position);
Returns: An iterator pointing to the element following the one that was erased, or end() if no such element exists.
iterator erase_after(const_iterator position, const_iterator last);
void resize(size_type sz);
Effects: If sz < distance(begin(), end()), erases the last distance(begin(), end()) - sz elements from the list. Otherwise, inserts sz - distance(begin(), end()) default-inserted elements at the end of the list.
void resize(size_type sz, const value_type& c);
Effects: If sz < distance(begin(), end()), erases the last distance(begin(), end()) - sz elements from the list. Otherwise, inserts sz - distance(begin(), end()) copies of c at the end of the list.
void clear() noexcept;