isSomeFunction

template isSomeFunction (
F...
) if (
F.length == 1
) {}

Members

Variables

isSomeFunction
enum bool isSomeFunction;
Undocumented in source.

Parameters

F

A symbol.

Return Value

$(D_KEYWORD true) if F is a function, function pointer or delegate, $(D_KEYWORD false) otherwise.

Examples

static assert(isSomeFunction!(void function()));
static assert(isSomeFunction!(() {}));
static assert(isSomeFunction!(void delegate()));

void func()
{
}
static void staticFunc()
{
}

static assert(isSomeFunction!func);
static assert(isSomeFunction!staticFunc);

auto functionPointer = &staticFunc;
auto dg = &func;

static assert(isSomeFunction!functionPointer);
static assert(isSomeFunction!dg);

static assert(!isSomeFunction!int);

See Also

$(D_PSYMBOL isFunction), $(D_PSYMBOL isDelegate), $(D_PSYMBOL isFunctionPointer).

Meta