Allow default constructors for structs

Ogi ogion.art at gmail.com
Fri Aug 30 16:17:08 UTC 2024


On Friday, 30 August 2024 at 12:45:27 UTC, monkyyy wrote:
> but this proposal does not maintain a .init "standard"
>
>>>>S v = S.init; // ok (may be a logically incorrect object)

Using `.init` to initialize a struct with a disabled default 
constructor is [well 
defined](https://dlang.org/spec/property.html#init-vs-construction) and allowed even in `@safe` code. This proposal doesn’t change anything in this regard.


More information about the dip.ideas mailing list