The OpenD Programming Language

FunctionTypeOf

Get the function type from a callable object func.

Using builtin typeof on a property function yields the types of the property value, not of the property function itself. Still, FunctionTypeOf is able to obtain function types of properties.

Note: Do not confuse function types with function pointer types; function types are usually used for compile-time reflection purposes.

template FunctionTypeOf (
alias func
) if (
isCallable!func
) {}

Examples

class C
{
    int value() @property { return 0; }
}
static assert(is( typeof(C.value) == int ));
static assert(is( FunctionTypeOf!(C.value) == function ));

Meta