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

1.7 KiB
Raw Permalink Blame History

[array.creation]

23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.3 Class template array [array]

23.3.3.6 Array creation functions [array.creation]

🔗

template<class T, size_t N> constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);

1

#

Mandates: is_array_v is false andis_constructible_v<remove_cv_t, T&> is true.

2

#

Preconditions: T meets the Cpp17CopyConstructible requirements.

3

#

Returns: {{ a[0], …, a[N - 1] }}.

🔗

template<class T, size_t N> constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);

4

#

Mandates: is_array_v is false andis_constructible_v<remove_cv_t, T> is true.

5

#

Preconditions: T meets the Cpp17MoveConstructible requirements.

6

#

Returns: {{ std::move(a[0]), …, std::move(a[N - 1]) }}.