
Andrew Sutton wrote:
But I'm not requiring both sides to be the same -- only related.
I'm not sure how you're doing that. I thought that this was about using the EqualityComparable standard requirement, which does require the two sides of == to be of the same type, and == to be an equivalence relation.
The standard does not say that about EqualityComparable. 17.6.3.1 [utility.arg.requirements] only says that a == b is convertible to bool and is an equivalence relation.
17.6.3.1? It's in 20.1.1 [lib.equalitycomparable] in C++03 and in 20.2.1 [utility.arg.requirements] in N3225. In C++03, the preceding text states: In Table 28, T is a type to be supplied by a C + + program instantiating a template, a, b and c are values of type T. In N3225, the text states that In these tables, T is an object or reference type to be supplied by a C++ program instantiating a template; a, b, and c are values of type (possibly const) T; s and t are modifiable lvalues of type T; u denotes an identifier; rv is an rvalue of type T; and v is an lvalue of type (possibly const) T or an rvalue of type const T. It makes sense, too; the table describes what it means for T to be EqualityComparable. What would be EqualityComparable if a, b and c were arbitrary?