https://news.ycombinator.com/item?id=26999909 has the right answer, IMO: you can have multiple equality comparators (and/or orderable comparators) and specify which to use in your collections like sets.
It's not clear that there should be a single notion of equality for any class/struct/whatever, but that there might need to be context-specific notions of equality.
It's not clear that there should be a single notion of equality for any class/struct/whatever, but that there might need to be context-specific notions of equality.