Doubt doubt doubt

why we use “size_t” as return type in custom hashfunc…???

Also, when we overload “==” and “( )” operators…the functions have to be const…?? If yes, why???

And can we make custom hash function for “map” instead of unordered map…???

@parth_tyagi

  1. size_t is a datatype like int, long etc meant specifically for storing size, meaning it has some additional constraints like it cannot be negative etc.
  2. https://www.geeksforgeeks.org/function-overloading-and-const-functions/
  3. map is not a hash based data structure so you cannot use a hash function for that. You need to know the internal implementation of the data structure before you try to customise 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.