DMD 1.035 and 2.019 releases

Walter Bright newshound1 at digitalmars.com
Wed Sep 3 00:32:02 PDT 2008


Extrawurst wrote:
> And why is it that there is no default ctor allowed for structs ?

Good question. Because:

1. Having a default ctor conflicts with the concept of a .init property.

2. Using .init for default construction guarantees it can never throw, 
which is a useful property in many generic programming circumstances

3. It guarantees it is pure.

4. Nearly every instance of default construction I've seen would 
initialize it just to what .init does in D.

5. It eliminates the need for a member initializer syntax.


More information about the Digitalmars-d-announce mailing list