assertIsPartOfUnion

Undocumented in source.
alias assertIsPartOfUnion(UnionT, ValueT) = ctassert!(isPartOfUnion!(UnionT, ValueT), "Type `" ~ ValueT.stringof ~ "` does not belong to union `" ~ UnionT.stringof ~ "`")

Examples

static union U
{
    int a;
}

static assert(__traits(compiles, assertIsPartOfUnion!(U, int)));
static assert(!__traits(compiles, assertIsPartOfUnion!(U, string)));

Meta