isUnaryOver

Returns true if the first argument is a unary function over the next parameter argument

Parameter arguments can be any compile time entity that can be typed. And the first argument can be a string that is also accpeted by std.functional.binaryFun in Phobos

Members

Manifest constants

isUnaryOver
enum isUnaryOver;
Undocumented in source.

Examples

void f0() {}
void f1(int a) {}
void f2(int a, int b) {}

static assert(!isUnaryOver!(null, int));
static assert( isUnaryOver!((a => a), int));
static assert(!isUnaryOver!((a, b) => a + b, int));

static assert(!isUnaryOver!(f0, int));
static assert( isUnaryOver!(f1, int));
static assert(!isUnaryOver!(f2, int));

static assert( isUnaryOver!(f1, 3));
static assert(!isUnaryOver!(f1, "ff"));
static assert(!isUnaryOver!(f1, 3, 4));
static assert( isUnaryOver!(typeof(f1), 3));
static assert(!isUnaryOver!(typeof(f1), "ff"));

Meta