std.container.array of struct inside a struct fails

Anton Fediushin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 14 09:53:03 PDT 2017


On Friday, 14 July 2017 at 16:42:59 UTC, drug wrote:
> It's because Array(T) is a value type and needs type size to 
> define itself, so you have expected forward reference. But T[] 
> is reference type and its size is known in advance - it doesn't 
> depend on type, it's always pointer.sizeof + length.sizeof, for 
> 64x architecture it is 16 bytes, so in this case you have no 
> the issue.
> It's not a bug at all.

Thank you!


More information about the Digitalmars-d-learn mailing list