hasOp

Checks if T1 and T2 have an operator op: T1 op T2

Members

Manifest constants

hasOp
enum hasOp;
Undocumented in source.
hasOp
enum hasOp;
Undocumented in source.

Examples

static assert(hasOp!(float, int, "*"));
static assert(hasOp!(double, double, "/"));
static assert(!hasOp!(double, void, "/"));
static assert(hasOp!(int, int, "/"));

struct B {}

struct A
{
    void opBinary(string op)(B b) if(op == "*") {}
}

static assert(hasOp!(A, B, "*"));

Meta