On Wed, 23 Jan 2019 15:19:06 +0000, Jacob Shtokolov wrote: > I'm wondering, is that possible to declare multiple versions of > opEquals() and evaluate them in the different places depending on return > type?
I looked at this a while ago for similar reasons. It didn't pan out. When you override the comparison operator, you can't distinguish which comparison is overloaded. It takes at least 2^n evaluations of the function to determine all the comparisons, possibly more. (I *think* you can observe the short-circuiting logic as you do those evaluations to determine how each comparison is combined.)