On 08/07/2012 06:40 AM, Tobias Pankrath wrote: > bool opEquals(R)(R rhs) { return x == rhs.x && y == rhs.y; } > bool opEquals(R)(R rhs) const { return x == rhs.x && y == rhs.y; }
I strongly recommend that only the const version should be defined. That would work on both mutable and immutable objects.
Besides, opEquals should not modify the object anyway; that would be surprising.
Ali