ReturnTypeOf

Deduces return type of a callable

Members

Aliases

ReturnTypeOf
alias ReturnTypeOf = typeof( ())
Undocumented in source.
ReturnTypeOf
alias ReturnTypeOf = typeof( ())
Undocumented in source.

Parameters

Callable

callable type (function/delegate/function pointer) or function symbol. Represented by variadic template of length 1 to accept both types and function symbols.

Return Value

evaluates to return type of the callable

Examples

static assert (is(ReturnTypeOf!(void function()) == void));
static assert (is(ReturnTypeOf!(int function(char)) == int));
static assert (is(ReturnTypeOf!(int delegate(char)) == int));

double foo ( char[], int ) { return 0; }
static assert (is(ReturnTypeOf!(foo) == double));
static assert (is(ReturnTypeOf!(typeof(&foo)) == double));

static assert (is(ReturnTypeOf!(int delegate(ref int)) == int));

Meta