它的hash_code是对raw_name使用了FNV-1a算法得到的。还有个例子是默认状态下的libstdc++,虽然它也符合 Itanium ABI 的要求,但是默认情况下仍然会对name本身进行 hash 操作得到hash_code,使用的是经典的MurmurHash2算法。libc++对于以上各种情况都有较好的适配,对于第二种情况它使用的 hash
std::type_info::hash_code std::size_thash_code()constnoexcept; (since C++11) Returns an unspecified value (here denoted byhash code) such that for allstd::type_infoobjects referring to the same type, theirhash codeis the same.
因此,C++11推出了std::function与std::bind这两件大杀器,他们配合起来能够很好的替代函数指针。
std::type_info::hash_code std::size_thash_code()constnoexcept; (C++11 起) 返回未指定值,使得指代同一类型的所有type_info对象的 hash_code() 相同。 不给出其他保证:指代不同类型的type_info对象可以拥有相同的 hash_code (尽管标准推荐实现尽可能避免这点),而同一类型的 hash_code 可在相同程序的各...
std::type_info::hash_code 的hash值一般是怎么算出来的?libstdc++ 里有这么一段:https://github....