Re: operator overloading compilation error

2011-07-26 Thread Diego Canuhé
thanks! On Tue, Jul 26, 2011 at 9:12 AM, bearophile wrote: > Diego Canuhé: > > > I'm trying to overload the "+" and "-" operators for a struct but I get > > this error > > > > test.d(47): Error: incompatible types for ((v1) - (v2)): 'Vecf!(1u)' and > > 'Vecf!(1u)' > > (the line corresponds to th

Re: operator overloading compilation error

2011-07-26 Thread bearophile
Diego Canuhé: > I'm trying to overload the "+" and "-" operators for a struct but I get > this error > > test.d(47): Error: incompatible types for ((v1) - (v2)): 'Vecf!(1u)' and > 'Vecf!(1u)' > (the line corresponds to the last assert) It's a dmd bug, and I think it's already in Bugzilla. This

operator overloading compilation error

2011-07-26 Thread Diego Canuhé
Hi I'm trying to overload the "+" and "-" operators for a struct but I get this error test.d(47): Error: incompatible types for ((v1) - (v2)): 'Vecf!(1u)' and 'Vecf!(1u)' (the line corresponds to the last assert) doing something like this struct Vecf(uint n) { ... Vecf!n opBinary(string