isDelegate

Delegate stores the function pointer and function context.

Members

Variables

isDelegate
enum bool isDelegate;
Undocumented in source.
isDelegate
enum bool isDelegate;
Undocumented in source.

Parameters

F

A symbol.

Return Value

$(D_KEYWORD true) if F is a delegate, $(D_KEYWORD false) delegate.

Examples

static assert(isDelegate!(void delegate()));
static assert(!isDelegate!(void function()));

static assert(!isDelegate!(() {}));

void func()
{
}
static void staticFunc()
{
}
interface I
{
    @property int prop();
}

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

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

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

static assert(!isDelegate!(I.prop));

See Also

Meta