Ary Borenszweig:

As a library solution I would do something like this:

Union!(int, string)[] elements;
elements ~= 1;
elements ~= "hello";

Take a look at Algebraic in Phobos.

Bye,
bearophile

Reply via email to