struct field initialization

bitwise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 16 11:11:05 PDT 2017


If I define a non-default constructor for a struct, are the 
fields initialized to T.init by the time it's called? or am I 
responsible for initializing all fields in that constructor?

..or do structs follow the same rules as classes?
https://dlang.org/spec/class.html#field-init

   Thanks



More information about the Digitalmars-d-learn mailing list