OriginalType

If T is an $(D_KEYWORD enum), OriginalType!T evaluates to the most base type of that $(D_KEYWORD enum) and to T otherwise.

Members

Aliases

OriginalType
alias OriginalType = OriginalType!U
Undocumented in source.
OriginalType
alias OriginalType = T
Undocumented in source.

Parameters

T

A type.

Return Value

Base type of the $(D_KEYWORD enum) T or T itself.

Examples

enum E1 : const(int)
{
    n = 0,
}
enum E2 : bool
{
    t = true,
}
enum E3 : E2
{
    t = E2.t,
}
enum E4 : const(E2)
{
    t = E2.t,
}

static assert(is(OriginalType!E1 == const int));
static assert(is(OriginalType!E2 == bool));
static assert(is(OriginalType!E3 == bool));
static assert(is(OriginalType!E4 == bool));
static assert(is(OriginalType!(const E4) == bool));

Meta