License:
BSD style: see license.txtAuthors:
Daniel Keep, Sean Kelly
1 2 | Variant v = Variant(42); v = "abc"; |
Params:
value | The value you wish to put in the Variant. |
Returns:
The new Variant.Example:
1 | auto v = Variant(42); |
Params:
type | Type of the value. |
ptr | Pointer to the value. |
Returns:
The new Variant.Example:
1 2 | int life = 42; auto v = Variant(typeid(typeof(life)), &life); |
Params:
value | The value you wish to put in the Variant. |
Returns:
The new value of the assigned-to variant.Example:
1 2 | Variant v; v = 42; |
Returns:
true if the Variant contains a value of type T, false otherwise.Example:
1 2 3 | auto v = Variant(cast(int) 42); assert( v.isA!(int) ); assert( ! v.isA!(short) ); // note no implicit conversion |
Returns:
true if the Variant contains a value of type T, or if the Variant contains a value that can be implicitly cast to type T; false otherwise.Example:
1 2 3 | auto v = Variant(cast(int) 42); assert( v.isA!(int) ); assert( v.isA!(short) ); // note implicit conversion |
Returns:
true if the Variant does not contain a value, false otherwise.Returns:
The string representation of the type contained within the Variant.