Share via


forward_list::forward_list

Constructs an object of type forward_list.

forward_list();
explicit forward_list(const Allocator& _Al);
explicit forward_list(size_type _Count);
forward_list(size_type _Count, const Type& _Val);
forward_list(size_type _Count, const Type& _Val,
    const Allocator& _Al);
forward_list(const forward_list& _Right);
template<class InputIterator>
    forward_list(InputIterator _First, InputIterator _Last);
template<class InputIterator>
    forward_list(InputIterator _First, InputIterator _Last,
    const Allocator& _Al);
forward_list(forward_list&& _Right);

Parameters

Parameter

Description

_Al

The allocator class to use with this object.

_Count

The number of elements in the list constructed.

_Val

The value of the elements in the list constructed.

_Right

The list of which the constructed list is to be a copy.

_First

The position of the first element in the range of elements to be copied.

_Last

The position of the first element beyond the range of elements to be copied.

Remarks

All constructors store an allocator and initialize the controlled sequence. The allocator object is the argument _Al, if present. For the copy constructor, it is _Right.get_allocator(). Otherwise, it is Allocator().

The first two constructors specify an empty initial controlled sequence. The third constructor specifies a repetition of _Count elements of value Type().

The fourth and fifth constructors specify a repetition of _Count elements of value _Val.

The sixth constructor specifies a copy of the sequence controlled by _Right. If InputIterator is an integer type, the next two constructors specify a repetition of (size_type)_First elements of value (Type)_Last. Otherwise, the next two constructors specify the sequence [_First, _Last).

The next two constructors specify the initial controlled sequence with an object of class initializer_list<Type>.

The last constructor is the same as the sixth, but with an rvalue reference.

Requirements

Header: <forward_list>

Namespace: std

See Also

Reference

forward_list Class