On Saturday, 2 January 2016 at 14:57:58 UTC, Shriramana Sharma wrote:
John Colvin wrote:

Strictly speaking you aren't calling a constructor there, you're writing a struct literal.

Why do you say I'm not calling a constructor?

https://dlang.org/spec/struct.html#struct-literal

And that still doesn't answer the question of why can't we have an automatic field-wise constructor for classes...

Classes aren't as simple as structs, they have hidden members, inherited members... Technically speaking the compiler is even allowed to change the ordering. They may be other reasons I'm not aware of / aren't thinking of right now.

Reply via email to