23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.4 Class template forward_list [forwardlist]

23.3.4.2 forward_list constructors, copy, assignment [forwardlist.cons]

explicit forward_list(const Allocator& = Allocator());

Effects: Constructs an empty forward_list object using the specified allocator.

Complexity: Constant.

explicit forward_list(size_type n);

Effects: Constructs a forward_list object with n value-initialized elements.

Requires: T shall be DefaultConstructible.

Complexity: Linear in n.

forward_list(size_type n, const T& value, const Allocator& = Allocator());

Effects: Constructs a forward_list object with n copies of value using the specified allocator.

Requires: T shall be CopyInsertable into *this.

Complexity: Linear in n.

template <class InputIterator> forward_list(InputIterator first, InputIterator last, const Allocator& = Allocator());

Effects: Constructs a forward_list object equal to the range [first,last).

Complexity: Linear in distance(first, last).

template <class InputIterator> void assign(InputIterator first, InputIterator last);

Effects: clear(); insert_after(before_begin(), first, last);

void assign(size_type n, const T& t);

Effects: clear(); insert_after(before_begin(), n, t);