Files
2025-10-25 03:02:53 +03:00

3.4 KiB
Raw Permalink Blame History

[forward.list.cons]

23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.7 Class template forward_list [forward.list]

23.3.7.2 Constructors, copy, and assignment [forward.list.cons]

🔗

constexpr explicit forward_list(const Allocator&);

1

#

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

2

#

Complexity: Constant.

🔗

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

3

#

Preconditions: T is Cpp17DefaultInsertable into forward_list.

4

#

Effects: Constructs a forward_list object with n default-inserted elements using the specified allocator.

5

#

Complexity: Linear in n.

🔗

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

6

#

Preconditions: T is Cpp17CopyInsertable into forward_list.

7

#

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

8

#

Complexity: Linear in n.

🔗

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

9

#

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

10

#

Complexity: Linear in distance(first, last).

🔗

template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1Introduction[container.intro.reqmts]")<T> R> constexpr forward_list(from_range_t, R&& rg, const Allocator& = Allocator());

11

#

Effects: Constructs a forward_list object with the elements of the range rg.

12

#

Complexity: Linear in ranges::distance(rg).