This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.

2590. Aggregate initialization for std::array

Section: 23.3.3.1 [array.overview] Status: C++17 Submitter: Robert Haberlach Opened: 2016-01-30 Last modified: 2017-07-30

Priority: 0

View other active issues in [array.overview].

View all other issues in [array.overview].

View all issues with C++17 status.

Discussion:

Similar to core issue 1270's resolution, 23.3.3.1 [array.overview]/2 should cover aggregate-initialization in general. As it stands, that paragraph solely mentions copy-list-initialization — i.e. it is unclear whether the following notation is (guaranteed to be) well-formed:

std::array<int, 1> arr{0};

[2016-02, Issues Telecon]

P0; move to Tentatively Ready.

Proposed resolution:

This wording is relative to N4567.

  1. Change 23.3.3.1 [array.overview] p2 as indicated:

    -2- An array is an aggregate (8.5.1) that can be list-initialized with the syntax

    array<T, N> a = { initializer-list };
    

    where initializer-list is a comma-separated list of up to N elements whose types are convertible to T.