Default struct constructor

Victor Porton porton at narod.ru
Wed Jan 30 12:29:46 UTC 2019


Why the language specification disables default constructors for 
structs?

It can be easily worked around:

---
struct Dummy { }

struct C {
     this(Dummy dummy) { }
}
---

But this workaround (using Dummy) is silly.

Isn't it better to allow default constructor and call it for both 
of the following?

C x;
C y = C();


More information about the Digitalmars-d mailing list