我想实现一个2D unordered_map,看起来像:创建2D unordered_map C++
std::unordered_map<std::string, std::unordered_map<std::string, double>>
因此,首先,我做执行内部unordered_graph:
std::unordered_map<std::string, std::unordered_map<std::string, double> *inner = new
std::unordered_map<std::string, std::unordered_map<std::string, double>>()
inner->insert(std::make_pair("X", 0));
然后,我试图通过做外部unordered_map
std::unordered_map<std::string, std::unordered_map<std::string, double> *outer =
std::unordered_map<std::string, std::unordered_map<std::string, double>>()
outer->insert("X", inner);
但它给我一个错误说no matching function for call to insert
你叫'inner'的那个实际上和外部映射一样。 * *它不是可编译的,因为你错过了一些关闭'>'。 – 2014-09-06 08:34:16