Fixing C's Biggest Mistake

Walter Bright newshound2 at digitalmars.com
Tue Dec 27 22:53:45 UTC 2022


On 12/27/2022 1:41 AM, Max Samukha wrote:
> If T.init is supposed to be an invalid value useful for debugging, then 
> variables initialized to that value... are not initialized.

It depends on the designed of the struct to decide on an initialized value that 
can be computed at compile time. This is not a failure, it's a positive feature. 
It means struct instances will *never* be in a garbage state.

C++ does it a different way, not a better way.


More information about the Digitalmars-d mailing list