Doc. no.: P0325R0
Date: 2016-03-31
Audience: Library Evolution Working Group
Reply-to: Zhihao Yuan <zy at miator dot net>

Propose to adopt make_array in C++17

Proposal

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

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

  2. The functionality is stable since the initial make_array paper[3].

  3. This facility is a pure addition.

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.

Wording

Copy the section 9.2.2 [container.array.creation][1] 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 <array> synopsis in 23.3.1/2 [sequences.general].

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

References

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

[2] LWG 851 simplified array construction. http://cplusplus.github.io/LWG/lwg-active.html#851

[3] N3824 make_array. http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3824.htm

[4] N4391 make_array, revision 4. http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4391.html