Anonymous structure
Tofu Ninja via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Apr 19 06:34:48 PDT 2016
On Monday, 18 April 2016 at 23:00:42 UTC, captaindet wrote:
> not sure what you mean by "named substructure, not a nested
> structure" but this works:
>
> struct Outer{
> struct Inner{
> int x;
> int y;
> int z;
> }
> Inner inner;
> int a;
> }
>
> Outer outer;
> outer.a = 7;
> outer.inner.y = 42;
> // outer.x = 13; //fails
>
> writeln(outer);
Yeah thats basicly what I meant, just sort of tedious to have to
write it like that, makes more complex layouts a real pain to
write.
More information about the Digitalmars-d-learn
mailing list