![]() |
STD-DISCUSSION |
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