TypeOf

Determines the type of T. If T is already a type, $(D_PSYMBOL TypeOf) aliases itself to T.

$(D_PSYMBOL TypeOf) evaluates to $(D_KEYWORD void) for template arguments.

The symbols that don't have a type and aren't types cannot be used as arguments to $(D_PSYMBOL TypeOf).

  1. alias TypeOf(T) = T
  2. template TypeOf(alias T)
    template TypeOf () if (
    isExpressions!T ||
    __traits(isTemplate, T)
    ) {}

Members

Aliases

TypeOf
alias TypeOf = typeof(T)
Undocumented in source.

Parameters

T

Expression, type or template.

Return Value

The type of T.

Examples

struct S(T)
{
}
static assert(is(TypeOf!S == void));
static assert(is(TypeOf!int == int));
static assert(is(TypeOf!true == bool));
static assert(!is(TypeOf!(tanya.meta)));

Meta