forcing "@nogc" on class destructors

via Digitalmars-d digitalmars-d at puremagic.com
Wed Jan 28 03:32:25 PST 2015


On Wednesday, 28 January 2015 at 10:36:11 UTC, Matthias Bentrup 
wrote:
> But wouldn't enforcing strict parent-child relationships make 
> cyclic references illegal ?

You would either need:

- serial number/timestamping (just a sort is required)

- dynamic information like a back pointer

- static typing like an ownership reference type

- behavioural typing (e.g. proper child references are inferred 
by looking at what is done in the constructor)

But I think GC and destructors are not a good match... so I would 
personally go for performance and no destructors.

But unions also have to be turned into strongly typed constructs 
for GC allocation if they can contain reference scanned memory. 
Behavioural typing could go a long way.


More information about the Digitalmars-d mailing list