We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// comparision 应该声明为公有,且const,不然hashmap和hashset的友元重载==函数无法调用私有函数,而且因为他们的参数都是const,因此声明为const bool equal_to_multi(const hashtable& other) const; bool equal_to_unique(const hashtable& other) const;
此外hashmap和hashset的重载函数都调用错了函数,应该调用的是equal_to_multi或者equal_to_unique,而不是equal_range_unique public: friend bool operator==(const unordered_set& lhs, const unordered_set& rhs) { return lhs.ht_.equal_range_unique(rhs.ht_); } friend bool operator!=(const unordered_set& lhs, const unordered_set& rhs) { return !lhs.ht_.equal_range_unique(rhs.ht_); } };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
// comparision 应该声明为公有,且const,不然hashmap和hashset的友元重载==函数无法调用私有函数,而且因为他们的参数都是const,因此声明为const
bool equal_to_multi(const hashtable& other) const;
bool equal_to_unique(const hashtable& other) const;
此外hashmap和hashset的重载函数都调用错了函数,应该调用的是equal_to_multi或者equal_to_unique,而不是equal_range_unique
public:
friend bool operator==(const unordered_set& lhs, const unordered_set& rhs)
{
return lhs.ht_.equal_range_unique(rhs.ht_);
}
friend bool operator!=(const unordered_set& lhs, const unordered_set& rhs)
{
return !lhs.ht_.equal_range_unique(rhs.ht_);
}
};
The text was updated successfully, but these errors were encountered: