BlackFly 1 day ago

I would say the answer is to replace both with explicit init unless you explicitly say some equivalent of "Trust me, bro," to the compiler. Some structs/data (especially RAII structs backing real resources) have no sensible default or zero.

But yeah, most structs have a good zero value so a shorthand to create that can be ergonomic over forced explicitness.

1
agent327 1 day ago

That would be a breaking change though. Having default zero-init would apply to existing source and convey it's benefits simply by recompiling, without any engineering hours being required.