Whats the difference between the working of this HashFn class and the bool operator == overloading or how are they both used in hashing in this case?
bool operator == (const Student &s){
return rollno==s.rollno;
}
here how is “rollno” used? Because s.rollno is passed by reference throught the function but “rollno” points to what?
class HashFn{
public:
size_t operator()(const Student &s) const{
return s.firstname.length()+s.lastname.length();
}
};
I would be really grateful for an elaborate explanation on this…