we didnt use == anywhere so why we overloaded it and if it is used where?
Why overloading of == is done
@kingshuk441 we are using it internally, We are using the in_built implementation of the unordered_map<> that is hidden from us and are modifying it so as that i can store class which it cannot without modification.
We define on overloaded () operator that will be our hash function
We define overloaded == that will help the interal implementation in dealing with situations when two keys are equal.
If this resolves your doubt mark it as resolved.
in unorder_map what == operator does?
whats the difference in our custom one?
@kingshuk441 hey have you seen the videos of hashing and collision handling in hashing?
This has to do with collision handling, when two there are two similar keys first aim is to identify them, and == does the same it compares two keys and checks if they are equal if they are equal we have collision and then inbuilt procedures are used to resolve it.
I would suggest watching videos of hashing for better understanding and resolve this doubt, and if you have doubt regarding collision/hashing raise it in hashing section.
If this resolves your doubt mark it as resolved.
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.