C++ unordered_map无法使用pair作为key的解决办法
最近在使用STL中unordered_map这种容器的时候发现无法将key设置为pair类型,编译报错信息为:
error: implicit instantiation of undefined template 'std::__1::hash<std::__1::pair<int, int> >
查了下资料才发现unordered_map中没有针对pair的hash函...
原创
2020-05-01 13:31:16 ·
6506 阅读 ·
0 评论