VariantN.peek

If the VariantN object holds a value of the exact type T, returns a pointer to that value. Otherwise, returns null. In cases where T is statically disallowed, peek will not compile.

struct VariantN(size_t maxDataSize, AllowedTypesParam...)
@property inout
inout(T)*
peek
(
T
)
()

Examples

Variant a = 5;
auto b = a.peek!(int);
assert(b !is null);
*b = 6;
assert(a == 6);

Meta

Suggestion Box / Bug Report