我一直在听C++中的仿函数.有人可以给我一个关于它们是什么的概述以及在什么情况下它们会有用吗?
这句话说什么:
return static_cast<Hasher &>(*this)(key);
?
我无法判断*thisor是否key被传递给static_cast. 我环顾四周,找到了这个答案,但与我所坚持的不同,第一对括号内没有任何内容。
在阅读用于std :: unordered_map的std :: hash示例时,我注意到{}正在访问operator()函数.
http://en.cppreference.com/w/cpp/utility/hash
result_type operator()(argument_type const& s) const
{
    result_type const h1 ( std::hash<std::string>{}(s.first_name) );
    result_type const h2 ( std::hash<std::string>{}(s.last_name) );
    return h1 ^ (h2 << 1); // or use boost::hash_combine (see Discussion)
}
这里使用{}代表什么?