The OpenD Programming Language

isTaggedVariant

Checks if the type is instance of tagged Algebraic.

Tagged algebraics can be defined with TaggedVariant.

enum bool isTaggedVariant(T);

Examples

static union MyUnion
{
    int integer;
    immutable(char)[] string;
}

alias MyAlgebraic = Algebraic!MyUnion;
static assert(isTaggedVariant!MyAlgebraic);

static assert(!isTaggedVariant!int);
static assert(!isTaggedVariant!(Variant!(int, string)));

Meta