Variant confusion

cal callumenator at gmail.com
Mon Mar 11 08:40:15 PDT 2013


On Monday, 11 March 2013 at 15:25:55 UTC, Peter Sommerfeld wrote:
> Seems I have to dig into the implementation for a workaround  
> or use
> my own union to integrate the types.
>
> Thanks, Peter

To get the held type of a Variant, use .type():

if(value.type() == typeid(Map))
    writeln("value == map");
else if(value.type() == typeid(Value))
    writeln("value == Value"); // Is still Value!

prints map.
	



More information about the Digitalmars-d-learn mailing list