On Thursday, 24 July 2014 at 00:31:55 UTC, Jonathan M Davis wrote:
I would argue that the compiler should still be generating opEquals even if opCmp is defined.

I take this back. As I later suggested in a post somewhere else in this thread (and the bug report that H.S. Teoh opened), I think that we should continue to not define opEquals, but we should add a way to tell the compiler to use the default-generated one (similar to what C++11 does). That way, the programmer is forced to consider what opEquals is supposed to do when opCmp is defined, but they're still able to use the default-generated one. The same goes for toHash.

Regardless, because automatically making opEquals be lhs.opCmp(rhs) == 0 incurs a silent performance hit, I think that it's a bad idea.

- Jonathan M Davis

Reply via email to