Otherwise,
all of
E's non-static data members
shall be direct members of
E or
of the same base class of
E,
well-formed when named as
e.name
in the context of the structured binding,
E shall not have an anonymous union member, and
the number of elements in the
attributed-identifier-list shall be
equal to the number of non-static data members of
E. Designating the non-static data members of
E as
m0,
m1,
m2,…
(in declaration order),
each
vi is the
name of an lvalue that refers to the member
mi of
e and
whose type is
that of
e.mi (
[expr.ref]);
the referenced type is
the declared type of
mi if that type is a reference type, or
the type of
e.mi otherwise
. The lvalue is a
bit-field if that member is a bit-field
. [
Example 2:
struct S { mutable int x1 : 2; volatile double y1; };
S f();
const auto [ x, y ] = f();
—
end example]