The OpenD Programming Language

isFunctionPointer

Detect whether symbol or type T is a function pointer.

enum bool isFunctionPointer(alias T);

Examples

static void foo() {}
void bar() {}

auto fpfoo = &foo;
static assert( isFunctionPointer!fpfoo);
static assert( isFunctionPointer!(void function()));

auto dgbar = &bar;
static assert(!isFunctionPointer!dgbar);
static assert(!isFunctionPointer!(void delegate()));
static assert(!isFunctionPointer!foo);
static assert(!isFunctionPointer!bar);

static assert( isFunctionPointer!((int a) {}));

Meta