7

I know, that in aggregate class

Each array element or non-static class member, in order of array subscript/appearance in the class definition, is copy-initialized from the corresponding clause of the initializer list.

But my question is: can we use previous initialized elements in initialization? Like:

std::array<int, 2> d = { 3, d[0] };

or

int d[] = {3, d[0]};

Thanks!

Bikineev
  • 1,685
  • 15
  • 20

0 Answers0