Question Details

No question body available.

Tags

c++ language-lawyer aggregate-initialization

Answers (1)

Accepted Answer Available
Accepted Answer
July 24, 2026 Score: 6 Rep: 231,178 Quality: Expert Completeness: 70%

In Appertainment

Each initializer clause in a brace-enclosed initializer list is said to appertain to an element of the aggregate being initialized or to an element of one of its subaggregates.

So

  1. the explicitly initialized elements of the aggregate are
    the elements with an appertained initializer clause
    and the elements having a subaggregate with an appertained initializer clause.

for your example

S2 y = {1, 2, 3, 4};

// 1 appertains to y.s.a

1 doesn't appertain to element y.s, but one of its subaggregate (y.s.a as noted).
y.s is a *"element having a subaggregate with an appertained initializer clause".