rt,不知道为什么没过编译,觉得是重载运算符的问题。
#include<unordered_map> using namespace std; struct gg{ int x,y; operator <(const gg g)const{return x<g.x;} operator >(const gg g)const{return x>g.x;} }; unordered_map<gg,int>mp; int main(){ mp[{1,2}]=3; }