I know that. I am speaking about that the quote from the Standard
 
 (3.2) — If the initializer list is an initializer-list, the explicitly
 initialized elements of the aggregate are the first n elements of the
 aggregate, where n is the number of elements in the initializer list.
 
is confusing..
 
 
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
 
 
Пятница, 11 декабря 2020, 22:41 +03:00 от Jason Cobb via Std-Discussion <std-discussion@lists.isocpp.org>:
 
On 12/11/20 2:38 PM, Vladimir Grigoriev via Std-Discussion wrote:
> In this declaration
>  
> B b = { 1, 2 };
>  
> there is initialized the object b of the aggregate B. The aggregate B
> has two elements: the direct base class A and the data member z.
>  
> According to the quote
>  
> (3.2) — If the initializer list is an initializer-list, the explicitly
> initialized elements of the aggregate are the first n elements of the
> aggregate, where n is the number of elements in the initializer list.
>  
> first two elements of the aggregate B are being  initialized. But this
> is not true. Only the single element that is the direct class A is
> initialized explicitly. So the quote  contradicts the realty.
>  
> With best regards
> (Vlad from Moscow)
> You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or
> http://ru.stackoverflow.com
>  


This is brace elision; see [dcl.init.aggr]/16.

--
Jason Cobb

Assessor, Rulekeepor, Stonemason

--
Std-Discussion mailing list
Std-Discussion@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion