C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Aggregate elements
From: Vladimir Grigoriev (vlad.moscow_at_[hidden])
Date: 2020-12-12 02:31:35


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_at_[hidden]>:
> 
>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_at_[hidden]
>https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
 



STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups