Variant.isA

This member can be used to determine if the value stored in the Variant is of the specified type. Note that this comparison is exact: it does not take implicit casting rules into account.

struct Variant
@property
bool
isA
(
T
)
()

Return Value

Type: bool

true if the Variant contains a value of type T, false otherwise.

Examples

auto v = Variant(cast(int) 42);
assert(   v.isA!(int) );
assert( ! v.isA!(short) ); // note no implicit conversion

Meta