我正在尝试使用unordered_map和另一个unordered_map作为键(自定义散列函数)。我还添加了一个自定义的相等函数,尽管它可能不需要。unsigned long hashing_func(const unordered_map<char,int>& m) { for (auto& e : m)>& m1, const unordered_map<char,int>& m2) {
return m1
因此,我试图将unordered_map设置为另一个unordered_map的值。现在,我遇到的问题是无法将值放入第二个unordered_map中。我的代码看起来是这样的。std::string postCode; std::unordered_map<std::string,unordered_map<int,Foo*>*> dat
墙壁用的std::unordered_map<int, std::unordered_map<int, AEntity*> >。另一个用于std::unordered_map<int, std::unordered_map<int, AEntity*> >的bombs+boxes。这就是我为什么想到unordered_maps的原因,我计划以这样的方式使用它们: KEY: y coord of the E
我尝试在C++程序中使用unordered_map,但每次都收到错误:boost/unordered_map.hpp: No such file or directory。但是,最初的unordered_map似乎不是一个Boost库实现,如果可能的话,我更喜欢使用这个标准。在没有Boost的情况下尝试正常编译时,我的#include和命令行可以正常工作,除了unordered_map的问题:
g++ -g -Wall testGame.cpp