Re: Templated struct operator overloading

2010-08-06 Thread Philippe Sigaud
On Fri, Aug 6, 2010 at 21:54, Peter Alexander wrote: > Is this a bug, or a limitation of how operator overloads handle generic > operands? > > struct Vec(int N) {} > > struct Mat(int M, int N) > { > Vec!(M) opBinary(string op)(in Vec!(N) rhs) > { > return Vec!(M)(); > }

Templated struct operator overloading

2010-08-06 Thread Peter Alexander
Is this a bug, or a limitation of how operator overloads handle generic operands? struct Vec(int N) {} struct Mat(int M, int N) { Vec!(M) opBinary(string op)(in Vec!(N) rhs) { return Vec!(M)(); } } void main() { Vec!(3) v; Mat!(3, 3) m;