Doubt in Unordered map

Please explain lines 35 - 37.

Thanks in advance.

Hey @gambhirrahul0 first understand sizeof. It’s a type which is used to represent the size of objects in bytes and is therefore used as the return type by the sizeof operator. It is guaranteed to be big enough to contain the size of the biggest object the host system can handle. Basically the maximum permissible size is dependent on the compiler; if the compiler is 32 bit then it is simply a typedef(i.e., alias) for unsigned int but if the compiler is 64 bit then it would be a typedef for unsigned long long . The size_t data type is never negative.

Therefore many C library functions declare their arguments and return type as size_t .
You can use int also here, whereas
operator()(const Student &s)const{ return s.firstname.length() + s.lastname.length(); }
is nothing but overloading of operator () now what it will do is return length of first name + second name and will return 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.