Skip to content

Commit 2dc989c

Browse files
committed
Apply N4391 per LWG Motion 5 at the 2015-05 Lenexa meeting.
http://wiki.edg.com/twiki/bin/view/Wg21lenexa/StrawPolls
1 parent 69a4cb8 commit 2dc989c

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

Diff for: container.html

+61
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,65 @@ <h1>Function template erase</h1>
153153
</cxx-note>
154154
</cxx-section>
155155
</cxx-section>
156+
157+
<cxx-section id="container.array">
158+
<h1>Class template <code>array</code></h1>
159+
160+
<cxx-section id="header.array.synop">
161+
<h1>Header &lt;experimental/array> synopsis</h1>
162+
163+
<pre><code>#include &lt;array>
164+
165+
namespace std {
166+
namespace experimental {
167+
inline namespace fundamentals_v2 {
168+
169+
<cxx-ref insynopsis to="container.array.creation"></cxx-ref>
170+
template &lt;class D = void, class... Types&gt;
171+
constexpr array&lt;<i>VT</i>, sizeof...(Types)&gt; make_array(Types&amp;&amp;... t);
172+
template &lt;class T, size_t N&gt;
173+
constexpr array&lt;remove_cv_t&lt;T&gt;, N&gt; to_array(T (&amp;a)[N]);
174+
175+
} // inline namespace fundamentals_v2
176+
} // namespace experimental
177+
} // namespace std</code></pre>
178+
</cxx-section>
179+
180+
<cxx-section id="container.array.creation">
181+
<h1>Array creation functions</h1>
182+
183+
<cxx-function>
184+
<cxx-signature>template &lt;class D = void, class... Types&gt;
185+
&nbsp;&nbsp;constexpr array&lt;<i>VT</i>, sizeof...(Types)&gt; make_array(Types&amp;&amp;... t);</cxx-signature>
186+
187+
<p>
188+
Let <em>Ui</em> be <code>decay_t&lt;</code><em>Ti</em><code>&gt;</code> for each <em>Ti</em> in <code>Types</code>.
189+
</p>
190+
<cxx-remarks>
191+
The program is ill-formed if <code>D</code> is <code>void</code> and at least one <em>Ui</em> is a specialization of <code>reference_wrapper</code>.
192+
</cxx-remarks>
193+
<cxx-returns>
194+
<code>array&lt;<var>VT</var>, sizeof...(Types)&gt;{ std::forward&lt;Types&gt;(t)... }</code>, where <code><var>VT</var></code> is <code>common_type_t&lt;Types...&gt;</code> if <code>D</code> is <code>void</code>, otherwise <code><var>VT</var></code> is <code>D</code>.
195+
</cxx-returns>
196+
197+
<cxx-example>
198+
<pre><code>int i = 1; int&amp; ri = i;
199+
auto a1 = make_array(i, ri); // a1<i> is of type </i>array&lt;int, 2&gt;
200+
auto a2 = make_array(i, ri, 42L); // a2<i> is of type </i>array&lt;long, 3&gt;
201+
auto a3 = make_array&lt;long&gt;(i, ri); // a3<i> is of type </i>array&lt;long, 2&gt;
202+
auto a4 = make_array&lt;long&gt;(); // a4<i> is of type </i>array&lt;long, 0&gt;
203+
auto a5 = make_array(); // <i>ill-formed</i></code></pre>
204+
</cxx-example>
205+
</cxx-function>
206+
207+
<cxx-function>
208+
<cxx-signature>template &lt;class T, size_t N&gt;
209+
constexpr array&lt;remove_cv_t&lt;T&gt;, N&gt; to_array(T (&amp;a)[N]);</cxx-signature>
210+
211+
<cxx-returns>
212+
An <code>array&lt;remove_cv_t&lt;T&gt;, N&gt;</code> such that each element is copy-initialized with the corresponding element of <code>a</code>.
213+
</cxx-returns>
214+
</cxx-function>
215+
</cxx-section>
216+
</cxx-section>
156217
</cxx-clause>

Diff for: general.html

+9
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ <h1>Namespaces, headers, and modifications to standard classes</h1>
106106
<caption>C++ library headers</caption>
107107
<tr><td>
108108
<ul>
109+
<li><code>&lt;experimental/array></code></li>
109110
<li><code>&lt;experimental/deque></code></li>
110111
<li><code>&lt;experimental/forward_list></code></li>
111112
<li><code>&lt;experimental/functional></code></li>
@@ -230,6 +231,14 @@ <h1>Feature-testing recommendations (Informative)</h1>
230231
<td>201411</td>
231232
<td><code>&lt;experimental/vector></code></td>
232233
</tr>
234+
<tr>
235+
<td>N4315</td>
236+
<td>make_array</td>
237+
<td><cxx-ref to="container.array.creation"></cxx-ref></td>
238+
<td><code>make_array</code></td>
239+
<td>201504</td>
240+
<td><code>&lt;experimental/array></code></td>
241+
</tr>
233242
<tr>
234243
<td>N4257</td>
235244
<td>Delimited iterators</td>

0 commit comments

Comments
 (0)