简体   繁体   English

STL贴图合成

[英]STL map composite

#include <iostream>
#include <algorithm>
#include <climits>
#include <map>
#include <unordered_map>
using namespace std;

int main()
{
    std::map<int, std::unordered_map<std::pair<int, int>, int>> region;
    region[0].insert(make_pair(make_pair(1, 1), 1));
    return 0;
}

I am writing the above code and it don't work as expected, How can I fixed it?我正在编写上面的代码,但它没有按预期工作,我该如何修复它? The error is " error C2064: term does not evaluate to a function taking 1 arguments"错误是“错误 C2064:术语不计算为采用 1 个参数的函数”

std::pair没有专门的std::hash ,因此它不能用作std::unordered_map的键,除非您提供自定义哈希函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM