DIP 1031--Deprecate Brace-Style Struct Initializers--Community Review Round 1 Discussion

Walter Bright newshound2 at digitalmars.com
Mon Feb 17 19:46:15 UTC 2020


On 2/15/2020 10:09 PM, Paul Backus wrote:
> On Sunday, 16 February 2020 at 05:57:22 UTC, Walter Bright wrote:
>> Left unsaid in all this is the static initializer syntax can only be use for 
>> statics, and even then only for structs without a constructor.
> 
> It actually works for dynamic initialization too:
> 
>> The static initializer syntax can also be used to initialize non-static 
>> variables. The initializer need not be evaluable at compile time.
> 
> Source: https://dlang.org/spec/struct.html#dynamic_struct_init

Yes, you're right. My mistake.


More information about the Digitalmars-d mailing list