On 8/25/2018 6:33 AM, Shachar Shemesh wrote:
If you allow a feature to be disabled, you really need to keep in mind that feature might be well and truly disabled.

Disabling default initializations is not @safe, and that means taking responsibility for it not being default initialized.

It's like turning off array bounds checking. Then it's up to you to ensure no buffer overflows are happening.

On a pragmatic note, what you're asking for is a set of nested try blocks, one for each field with a throwing constructor, as opposed to one try block around the entire function. This is an expensive proposition in terms of performance. You'll need to weigh that very carefully against saving the default zero initialization of the struct, which is very efficient.

Reply via email to