C++ Logo

std-discussion

Advanced search

Aggregate initialization with reuse?

From: Bjorn Reese <breese_at_[hidden]>
Date: Sun, 2 Jun 2019 15:26:50 +0200
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};

Received on 2019-06-02 08:28:38