WTF! new in class is static?!?!

Ethan gooberman at gmail.com
Thu Jun 7 21:26:22 UTC 2018


On Thursday, 7 June 2018 at 21:07:26 UTC, DigitalDesigns wrote:
> assert(b1.a == b2.a)!!

The spec isn't clear on this but it uses the same rules as struct 
field initialisation, ie it's defined once and copied to each 
instance on creation.

https://dlang.org/spec/struct.html#default_struct_init


More information about the Digitalmars-d-learn mailing list