On 10/18/2010 09:07, Steven Schveighoffer wrote: > What case were you thinking of for requiring mutablity for equality > testing?
What about caching? class C { private int hashValue = -1; // Mutators reset hashValue to -1. int getHash() { if (this.hashValue == -1) { this.hashValue = longExpensiveCalculation(); } return this.hashValue(); } bool opEquals(C other) { if (this.getHash() == other.getHash()) { return slowElementwiseCompare(this, other); } else { return false; } } } -- Rainer Deyke - rain...@eldwood.com