isFunction

Detect whether symbol or type X is a function. This is different that finding if a symbol is callable or satisfying is(X == function), it finds specifically if the symbol represents a normal function declaration, i.e. not a delegate or a function pointer.

template isFunction (
X...
) if (
X.length == 1
) {
enum isFunction;
enum isFunction;
enum isFunction;
}

Return Value

true if X is a function, false otherwise

Examples

static void func(){}
static assert(isFunction!func);

struct S
{
    void func(){}
}
static assert(isFunction!(S.func));

See Also

Use isFunctionPointer or isDelegate for detecting those types respectively.

Meta

Suggestion Box / Bug Report