On Mon, Apr 19, 2010 at 21:52, Ali Çehreli <acehr...@yahoo.com> wrote:
> Ellery Newcomer wrote: > >> I want to be able to store heterogeneous T!(S) in a single list >> > > std.boxer or std.variant may be useful: > > http://digitalmars.com/d/2.0/phobos/std_boxer.html > > http://digitalmars.com/d/2.0/phobos/std_variant.html > > Ali > But how do you get back what was stored inside a Variant without any indication as to what it was initially? As far as I get it, Variant is useful to have a variable that can be assigned with many other variables of different types during its lifetime. I also regularly want to use it to store _one_ thing, anything, to get it back later. But then I'm at a loss as to how crack open the Variant afterwards, without storing some sort of type information somewhere.