Hacker News new | past | comments | ask | show | jobs | submit login

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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: