This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 113d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-03-20


990. Value initialization with multiple initializer-list constructors

Section: 9.4.5  [dcl.init.list]     Status: CD2     Submitter: Daniel Krügler     Date: 20 October, 2009

[Voted into WP at March, 2010 meeting as part of document N3079.]

It should always be possible to use the new brace syntax to value-initialize an object. However, the current rules make the following example ill-formed because of ambiguity:

    struct S {
      S();
      S(std::initializer_list<int>);
      S(std::initializer_list<double>);
    };
    S s{};    // Ambiguous initializer-list constructor reference,
              // not value initialization.

Proposed resolution (February, 2010):

Change 9.4.5 [dcl.init.list] paragraph 3 as follows:

List-initialization of an object or reference of type T is defined as follows: