From Jason Turner

[array.creation]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpbrxnsn8z/{from.md → to.md} +26 -0
tmp/tmpbrxnsn8z/{from.md → to.md} RENAMED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Array creation functions <a id="array.creation">[[array.creation]]</a>
2
+
3
+ ``` cpp
4
+ template<class T, size_t N>
5
+ constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
6
+ ```
7
+
8
+ *Mandates:* `is_array_v<T>` is `false` and `is_constructible_v<T, T&>`
9
+ is `true`.
10
+
11
+ *Preconditions:* `T` meets the *Cpp17CopyConstructible* requirements.
12
+
13
+ *Returns:* `{{ a[0], `…`, a[N - 1] }}`.
14
+
15
+ ``` cpp
16
+ template<class T, size_t N>
17
+ constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
18
+ ```
19
+
20
+ *Mandates:* `is_array_v<T>` is `false` and `is_move_constructible_v<T>`
21
+ is `true`.
22
+
23
+ *Preconditions:* `T` meets the *Cpp17MoveConstructible* requirements.
24
+
25
+ *Returns:* `{{ std::move(a[0]), `…`, std::move(a[N - 1]) }}`.
26
+