Algebraic Data Types in D?

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 1 00:38:32 PDT 2014


Andrei Alexandrescu:

> I do agree tagged unions should be pushed into the language; 
> they'd help the GC.

A more general solution is to add a onGC() optional method that 
gets called by the GC on collections, and tells it what's inside 
the union.

Bye,
bearophile


More information about the Digitalmars-d mailing list