Questions tagged «hashtree»

2
使用自定义类类型作为键的C ++ unordered_map
我正在尝试使用自定义类作为的键unordered_map,如下所示: #include <iostream> #include <algorithm> #include <unordered_map> using namespace std; class node; class Solution; class Node { public: int a; int b; int c; Node(){} Node(vector<int> v) { sort(v.begin(), v.end()); a = v[0]; b = v[1]; c = v[2]; } bool operator==(Node i) { if ( i.a==this->a && i.b==this->b &&i.c==this->c …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.