<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xml:lang="en">
<head><meta http-equiv="Content-type" content="application/xhtml+xml;charset=utf-8" /><title>Propose to adopt make_array in C++17</title></head>
<body><!-- maruku -o make_array_17.html make_array_17.md --><style type='text/css'>
pre code { display: block; margin-left: 2em; }
div { display: block; margin-left: 2em; }
ins { text-decoration: none; font-weight: bold; background-color: #A0FFA0 }
del { text-decoration: line-through; background-color: #FFA0A0 }
</style><table><tbody>
<tr><th>Doc. no.:</th>	<td>P0325R0</td></tr>
<tr><th>Date:</th>	<td>2016-03-31</td></tr>
<tr><th>Audience:</th>	<td>Library Evolution Working Group</td></tr>
<tr><th>Reply-to:</th>	<td>Zhihao Yuan &lt;zy at miator dot net&gt;</td></tr>
</tbody></table>
<h1 id="propose_to_adopt_make_array_in_c17">Propose to adopt make_array in C++17</h1>

<h2 id="proposal">Proposal</h2>

<p>This paper proposes to adopt the “Array creation functions”<code>[1]</code> in Library Fundamentals v2 into the C++17 working paper, for the following reasons:</p>

<ol>
<li>
<p>This facility is useful, and has been replicated/reinvented in many places/codebases, also been an LWG issue since 2008<code>[2]</code>, while the design adopted in TSv2 is of the least controversial among those.</p>
</li>

<li>
<p>The functionality is stable since the initial <code>make_array</code> paper<code>[3]</code>.</p>
</li>

<li>
<p>This facility is a pure addition.</p>
</li>
</ol>

<p>A note about whether this facility may be superseded by the deduced constructors: the presence of the constructors are contradictory to the concept of aggregate types. This have been discussed at the first meeting when the initial paper was presented.</p>

<h2 id="wording">Wording</h2>

<p>Copy the section 9.2.2 [container.array.creation]<code>[1]</code> from Library Fundamentals v2 to the IS working paper, as a new section 23.3.2.9 between [array.zero] and [array.tuple], and adjust the <code>&lt;array&gt;</code> synopsis in 23.3.1/2 [sequences.general].</p>

<p>Alternatively, apply the wording in the adopted paper<code>[4]</code>, which contains the wording with the same content but relative to the IS working paper.</p>

<h2 id="references">References</h2>

<p><code>[1]</code> Array creation functions. N4564 <em>Programming Languages – C++ Extensions for Library Fundamentals, Version 2</em>. <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4564.pdf#page=104&zoom=auto,0,590">http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4564.pdf#page=104&zoom=auto,0,590</a></p>

<p><code>[2]</code> LWG 851 <em>simplified array construction</em>. <a href="http://cplusplus.github.io/LWG/lwg-active.html#851">http://cplusplus.github.io/LWG/lwg-active.html#851</a></p>

<p><code>[3]</code> N3824 <em>make_array</em>. <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3824.htm">http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3824.htm</a></p>

<p><code>[4]</code> N4391 <em>make_array, revision 4</em>. <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4391.html">http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4391.html</a></p>
</body></html>
