<br><br><div class="gmail_quote">On Mon, Apr 19, 2010 at 21:52, Ali Çehreli <span dir="ltr"><<a href="mailto:acehreli@yahoo.com">acehreli@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Ellery Newcomer wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I want to be able to store heterogeneous T!(S) in a single list<br>
</blockquote>
<br></div>
std.boxer or std.variant may be useful:<br>
<br>
<a href="http://digitalmars.com/d/2.0/phobos/std_boxer.html" target="_blank">http://digitalmars.com/d/2.0/phobos/std_boxer.html</a><br>
<br>
<a href="http://digitalmars.com/d/2.0/phobos/std_variant.html" target="_blank">http://digitalmars.com/d/2.0/phobos/std_variant.html</a><br><font color="#888888">
<br>
Ali<br>
</font></blockquote></div><br>But how do you get back what was stored inside a Variant without any indication as to what it was initially? <br>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. <br>
<br>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.<br>
<br>