Should struct destructors be required to be @nogc?

deadalnix deadalnix at gmail.com
Fri Sep 15 23:32:00 UTC 2023


On Thursday, 14 September 2023 at 09:29:21 UTC, Commander Zot 
wrote:
> i'd prefer: don't call destructors from the GC at all, it was 
> never guaranteed anyway as far as i know. introduce finalizers, 
> which are _only_ called by the GC and are @nogc.

I don't see why that should be a problem at all. Java, C# and 
friend all support allocation during finalization and even object 
resurrection.

At some point, we got to stop chasing the new trendy feature, and 
make sure the one we have work properly up to the standard a 
modern dev can expect.


More information about the Digitalmars-d mailing list