However, unordered containers are actually only a little faster than the normal ones and should be avoided due to the complexity and the danger of requiring a lot of runtime quickly, especially with custom data types. It is therefore best never to implement your own hash function. Heres a qu...
//std::unordered_map<const i_b*, c*, std::hash<const i_b*>, std::equal_to<const i_b*>> Bs_to_Cs_{};//working fine, but no custom allocator std::unordered_map<const i_b*, c*, std::hash<const i_b*>, std::equal_to<const i_b*>, tlsf_allocator::allocator_for<std::...
71 + std::size_t operator()(const HashKeyStruct& s) const noexcept 72 + { 73 + const std::size_t h1 = std::hash<int>{} (s.first); 74 + const std::size_t h2 = std::hash<int>{} (s.second.first); 75 + const std::size_t h3 = std::hash<int>{} (s.second.se...
typedef std::unordered_map<const key_t,data,key_hash,key_equal> map_t; // ^ this is our custom hash 最后,正如 Benjamin Lindley 已经回答的那样,您需要使用std::make_tuple: And finally, as Benjamin Lindley answer already addresses, you need to usestd::make_tuple: // d is data m[std:...