相关疑难解决方法(0)

如何在C++ 0x中组合哈希值?

C++ 0x添加hash<...>(...).

我找不到一个hash_combine函数,如boost中所示.实现这样的事最简洁的方法是什么?也许,使用C++ 0x xor_combine?

c++ hash boost std c++11

78
推荐指数
6
解决办法
3万
查看次数

unordered_map/unordered_set中元组的通用哈希

为什么不std::unordered_map<tuple<int, int>, string>开箱即用?必须为tuple<int, int>例如定义散列函数是繁琐的

template<> struct do_hash<tuple<int, int>>                               
{   size_t operator()(std::tuple<int, int> const& tt) const {...}  }; 
Run Code Online (Sandbox Code Playgroud)

构建一个以元组为键的无序映射(Matthieu M.)展示了如何自动执行此操作boost::tuple.有没有为c ++ 0x元组执行此操作而不使用可变参数模板?

当然这应该在标准:(

c++ unordered-map tuples unordered-set c++11

27
推荐指数
4
解决办法
2万
查看次数

标签 统计

c++ ×2

c++11 ×2

boost ×1

hash ×1

std ×1

tuples ×1

unordered-map ×1

unordered-set ×1