Merge pull request #21 from s-ludwig/issue_18_opbinary_ambiguity
Don't define ambiguous opBinary/opBinaryRight overloads
This commit is contained in:
commit
b78003531e
|
@ -208,7 +208,9 @@ struct TaggedAlgebraic(U) if (is(U == union) || is(U == struct))
|
|||
/// Enables the use of binary operators with the stored value.
|
||||
auto opBinary(string op, T, this TA)(auto ref T other) if (hasOp!(TA, OpKind.binary, op, T)) { return implementOp!(OpKind.binary, op)(this, other); }
|
||||
/// Enables the use of binary operators with the stored value.
|
||||
auto opBinaryRight(string op, T, this TA)(auto ref T other) if (hasOp!(TA, OpKind.binaryRight, op, T)) { return implementOp!(OpKind.binaryRight, op)(this, other); }
|
||||
auto opBinaryRight(string op, T, this TA)(auto ref T other) if (hasOp!(TA, OpKind.binaryRight, op, T) && !isInstanceOf!(TaggedAlgebraic, T)) { return implementOp!(OpKind.binaryRight, op)(this, other); }
|
||||
/// ditto
|
||||
auto opBinaryRight(string op, T, this TA)(auto ref T other) if (hasOp!(TA, OpKind.binaryRight, op, T) && isInstanceOf!(TaggedAlgebraic, T) && !hasOp!(T, OpKind.opBinary, op, TA)) { return implementOp!(OpKind.binaryRight, op)(this, other); }
|
||||
/// Enables operator assignments on the stored value.
|
||||
auto opOpAssign(string op, T, this TA)(auto ref T other) if (hasOp!(TA, OpKind.binary, op~"=", T)) { return implementOp!(OpKind.binary, op~"=")(this, other); }
|
||||
/// Enables indexing operations on the stored value.
|
||||
|
|
Loading…
Reference in a new issue