Why allow initializers of non-static members that allocate?

Mike Parker aldacron at gmail.com
Fri Jun 10 17:20:15 UTC 2022


On Friday, 10 June 2022 at 14:56:24 UTC, Steven Schveighoffer 
wrote:

> Discovered circa 2009: 
> https://issues.dlang.org/show_bug.cgi?id=2947
>
> It should be illegal to declare a field this way that has 
> mutable references without being `shared`. End of story.
>
> -Steve

The docs do say that:

> The default initializers may not contain references to mutable 
> data.


More information about the Digitalmars-d-learn mailing list