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, "*"));
Checks if T1 and T2 have an operator op: T1 op T2