Rolf Magnus said:
Because you claim that this is possible.
No, I do not. I claim that you can have two vectors of which neither is
shorter than the other yet their *directions* are not equal.
Above, you wrote: "That won't work for std::set" and "With your definition,
you can have objects a, b for which none of a<b, b<a, a==b is true", and
that's not right.
But it is. That operator < defines equivalence classes which don't
correspond to vector equality. Therefore (the conventional meaning of)
== is inconsistent with <.
We can argue about the usefulness of that operator<, but
that's another story.
It's fine (ie it's a strict weak ordering) so far as the inner workings
of std::set go, but it defines an equivalence which doesn't match the
usual interpretation of vector equality. When looking things up in sets
or maps, it's the equivalence, not the ordering, which is important.
Yes, that's because they are considered equal in that case.
Not equal, equivalent. My point is that this equivalence is not equality
because information is discarded.
If you have std::set<std::string> and use a case-insensitive comparison, you
can also try to put two different strings in a set and only one will be
stored.
Of course. The difference is that case-insensitive "equality" is
sometimes a useful way of defining equivalence classes for strings.
Direction-insensitive "equality" is not a correspondingly useful concept
for vectors.