wg21.cmeerw.net

Proposed resolution (February, 2012):

Change 9.5.2 [dcl.init.aggr] paragraph 11 as follows:

In a declaration of the form

    T x = { a };

braces Braces can be elided in an initializer-list as follows. [Footnote: Braces cannot be elided in other uses of list-initialization. —end footnote]

Issue 1232 extended the language to allow creation of array temporaries using initializer lists. However, such initializer lists must be “completely braced;” the elision of braces described in 9.5.2 [dcl.init.aggr] paragraph 11 applies only

In a declaration of the form

  T x = { a };

This restriction prevents plausible uses like

    array<int, 3> f() {
      return { 1, 2, 3 };
    }

History Date User Action Args 2014-03-03 00:00:00adminsetstatus: drwp -> cd3 2013-05-03 00:00:00adminsetstatus: dr -> drwp 2012-11-03 00:00:00adminsetmessages: + msg4147 2012-11-03 00:00:00adminsetstatus: ready -> dr 2012-02-27 00:00:00adminsetmessages: + msg3723 2012-02-27 00:00:00adminsetstatus: drafting -> ready 2011-03-23 00:00:00admincreate

Read the original on wg21.cmeerw.net ↗