On 5/12/2014 10:25 AM, bearophile wrote:
Walter Bright:
Unions of pointers are so rare in actual code that treating them
conservatively is not a big problem.
std.variant.Algebraic is based on on std.variant.VariantN, and on
std.variant.VariantN is based on an union, and often you use algebraic data
types to represent trees and similar data structures that contain many
references/pointers. Adding Adding an onGC() method to std.variant.VariantN you
allow the GC to manage Algebraic well enough.
BTW, the RTinfo can be used to discriminate unions.