October 04, 2019 Re: Structs are Not Plain: A call for empty struct constructors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Olivier FAURE | On Monday, 23 September 2019 at 09:03:25 UTC, Olivier FAURE wrote:
> I just want to point out that this isn't an inherently unsolvable problem. You can have a type system where leaving your variable uninitialized is statically forbidden
The problem is containers like arrays. It is difficult to prove that every element has been initialized.
Btw, having everything zero-initialized by default has a performance advantage (you can have a background thread zero out the unused memory pool).
|
Copyright © 1999-2021 by the D Language Foundation