Movement against float.init being nan

Steven Schveighoffer schveiguy at gmail.com
Sat Aug 20 03:15:37 UTC 2022


On 8/19/22 8:49 PM, Walter Bright wrote:
> On 8/19/2022 10:14 AM, Steven Schveighoffer wrote:
>> ```c
>> ReallyLargeStruct foo = { 0 };
>> ```
> 
> D allows the setting of the default initializer for fields of a struct.

Yes, and then you aren't forced to initialize the big struct. Which is 
what I did. But if I forget to initialize a float somewhere in there, 
then it's ruined.

I suppose I can write a unittest to test that it's all zeroes.

But I also find it ironic that you are promoting using the struct's init 
value as a feature, but not a basic type's init value.

-Steve


More information about the Digitalmars-d mailing list