please explain me that why are we creating hashfunc class …can’t we just simply create hash function …
and what’s the logic behind overloading function call operator…
please explain me that why are we creating hashfunc class …can’t we just simply create hash function …
and what’s the logic behind overloading function call operator…
See whenever we use unordered_map for custom key, we need to provide a hash function so that position of particular key can be decided, Now in the implementation of STL, () is used for generating hashkey, hence () operator is overloaded.
In your personal implementation of hashmap you can do it using simple function, but when you use STL version, you have to act according to standards of STL.
okay okay now i got it
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.