Re: Operator Overloading in an Abstract Base Class

2014-11-21 Thread Nordlöw
On Thursday, 20 November 2014 at 22:35:51 UTC, IgorStepanov wrote: class Patt { // It is better then your static if. // Compiler will raise better error message for incorrect operator. Seq opBinary(string op)(Patt rhs) if (op == ~) { return opCatImpl(rhs); }

Operator Overloading in an Abstract Base Class

2014-11-20 Thread Nordlöw
in the unittest at https://github.com/nordlow/justd/blob/master/symbolic.d#L347 Isn't it possible to do operator overloading in an abstract base-class?

Re: Operator Overloading in an Abstract Base Class

2014-11-20 Thread Nordlöw
On Thursday, 20 November 2014 at 22:10:28 UTC, Nordlöw wrote: In my module symbolic.d at https://github.com/nordlow/justd/blob/master/symbolic.d is it somehow possible to overload binary operator ~ on pairs of instances SPatt? As usual I had done a couple of mistakes...which are solved know

Re: Operator Overloading in an Abstract Base Class

2014-11-20 Thread Ali Çehreli via Digitalmars-d-learn
On 11/20/2014 02:18 PM, Nordlöw wrote: On Thursday, 20 November 2014 at 22:10:28 UTC, Nordlöw wrote: In my module symbolic.d at https://github.com/nordlow/justd/blob/master/symbolic.d is it somehow possible to overload binary operator ~ on pairs of instances SPatt? As usual I had done a

Re: Operator Overloading in an Abstract Base Class

2014-11-20 Thread IgorStepanov via Digitalmars-d-learn
/justd/blob/master/symbolic.d#L332 is not called in the unittest at https://github.com/nordlow/justd/blob/master/symbolic.d#L347 Isn't it possible to do operator overloading in an abstract base-class? Seq opBinary(string op)(Patt rhs) { static if (op == ~) { return seq