Variant v = Variant(42); v = "abc";
value | The value you wish to put in the Variant. |
auto v = Variant(42);
type | Type of the value. |
ptr | Pointer to the value. |
int life = 42; auto v = Variant(typeid(typeof(life)), &life);
value | The value you wish to put in the Variant. |
Variant v; v = 42;
auto v = Variant(cast(int) 42); assert( v.isA!(int) ); assert( ! v.isA!(short) ); // note no implicit conversion
auto v = Variant(cast(int) 42); assert( v.isA!(int) ); assert( v.isA!(short) ); // note implicit conversion