class Graph
{
public:
unordered_map<int, Node> nodes;
unordered_set<Edge> edges;
};
编译时出错
error C2280: “std::_Uhash_compare<_Kty,_Hasher,_Keyeq>::_Uhash_compare(const std::_Uhash_compare<_Kty,_Hasher,_Keyeq> &)”: 尝试引用已删除的函数
1> with
1> [
1> _Kty=Edge,
1> _Hasher=std::hash<Edge>,
1> _Keyeq=std::equal_to<Edge>
1> ]
试试 重载Edge的operator==,或者operator>
应该怎么重载啊,我这样写为啥不行
bool operator==(const Node& another)
{
if (this == &another)
return true;
else return false;
}