C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Aggregate initialization with reuse?
From: Language Lawyer (language.lawyer_at_[hidden])
Date: 2019-06-02 09:34:23


https://stackoverflow.com/a/32945791/9585016

On 02/06/2019 16:26, Bjorn Reese via Std-Discussion wrote:
> Assuming I have an aggregate, is it legal to initialize later member
> variables with earlier member variables?
>
> For instance, is it legal to use a.x in the aggregate initialization
> below:
>
>   struct {
>     int x;
>     int y;
>   } a{42, a.x};


STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups