I remember having read somewhere that it’s possible to override the .init property of custom types in D. I’d like to do this for a struct I’ve created, but I’m not finding any way to do this, especially since default constructors aren’t allowed. Is this actually possible, and if so, how can I do this?
I remember having read somewhere that it’s possible to override the .init property of
Share
you can specify the init values of the fields (with compile time vars only)
foo.initwill then be equal tofoo(0,5.0)