Re: How do you overload opEquals?

2013-11-19 Thread Dale Matthews
On Tuesday, 19 November 2013 at 21:22:27 UTC, Adam D. Ruppe wrote: IGNORE ME, I am wrong here. I mixed up opEquals and opAssign in my head. Sorry! Will do :]

Re: How do you overload opEquals?

2013-11-19 Thread Dale Matthews
On Tuesday, 19 November 2013 at 21:10:57 UTC, Chris Nicholson-Sauls wrote: override bool opEquals (Object o) const { if ( auto v = cast( typeof( this ) ) o ) return x == v.x && y == v.y && z == v.z; return false; } You need: 1) 'override' in order to override

How do you overload opEquals?

2013-11-19 Thread Dale Matthews
I'm brand new to D and I'm taking on a project. In the midst, I've overloaded a whole load of operators for my Vec3 class. Most seem to be working (I haven't tested them all yet) but opEquals is refusing to be called. I've followed the guidelines here: http://dlang.org/operatoroverloading.html#