为什么不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 {...} };
以元组为键(Matthieu M.)构建无序地图显示了如何自动执行boost::tuple。有没有为c ++ 0x元组执行此操作而不使用可变参数模板?
相关分类