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.

Bye,
bearophile

Reply via email to