Why overload == operator in case of unordered sets?

When using custom class with sets, maps we only overload the < operator or we define a functor class and pass it. There we were not overloading the == operator for the custom class. There we had find() method in sets and maps which also match two objects. But there we were not overloading == operator.
But why do we then need to overload == in case of unordered map?? How do maps and sets compare two objects then??

Hey @gaganwalia212
Compiler has zero idea about user defined datatype , so it is always our responsibility to teach compiler how to hash it or how to compare them etc.

And that is why we are overloading == here as well

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.