[forwardlist.cons] (original) (raw)

22 Containers library [containers]

22.3 Sequence containers [sequences]

22.3.9 Class template forward_­list [forwardlist]

22.3.9.2 Constructors, copy, and assignment [forwardlist.cons]

explicit forward_list(const Allocator&);

Effects:Constructs an empty forward_­list object using the specified allocator.

explicit forward_list(size_type n, const Allocator& = Allocator());

Preconditions: T is Cpp17DefaultInsertable into *this.

Effects:Constructs a forward_­list object with ndefault-inserted elements using the specified allocator.

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

Preconditions: T is Cpp17CopyInsertable into *this.

Effects:Constructs a forward_­list object with n copies of value using the specified allocator.

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).