std::hash
is a class type. What you are doing here is constructing a temporary std::hash
with hash<string>()
and then (sd.isbn())
calls the operator()
of that temporary passing it sd.isbn()
.
It would be the same as
std::hash<std::string> temp;
return temp(sd.isbn());
For more reading on using objects that have a operator()
see: C++ Functors - and their uses
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…