ReturnType

Get the type of the return value from a function, a pointer to function, a delegate, a struct with an opCall, a pointer to a struct with an opCall, or a class with an opCall. Please note that $(D_KEYWORD ref) is not part of a type, but the attribute of the function (see template functionAttributes).

template ReturnType (
func...
) if (
func.length == 1 &&
isCallable!func
) {}

Examples

int foo();
ReturnType!foo x;   // x is declared as int

Meta

Suggestion Box / Bug Report