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
template <class T, class Hash, class KeyEqual> bool hashtable<T, Hash, KeyEqual>::equal_to_multi(const hashtable& other) { if (size_ != other.size_) return false; for (auto f = begin(), l = end(); f != l;) { auto p1 = equal_range_multi(value_traits::get_key(*f)); auto p2 = other.equal_range_multi(value_traits::get_key(*f)); if (mystl::distance(p1.first, p1.last) != mystl::distance(p2.first, p2.last) || !mystl::is_permutation(p1.first, p2.last, p2.first, p2.last)) return false; f = p1.last; } return true; }
只判断了other包含了该hashtable中所有的元素,应该继续判断该hashtable是否包含了other中所有的元素,互相包含才相等。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
template <class T, class Hash, class KeyEqual>
bool hashtable<T, Hash, KeyEqual>::equal_to_multi(const hashtable& other)
{
if (size_ != other.size_)
return false;
for (auto f = begin(), l = end(); f != l;)
{
auto p1 = equal_range_multi(value_traits::get_key(*f));
auto p2 = other.equal_range_multi(value_traits::get_key(*f));
if (mystl::distance(p1.first, p1.last) != mystl::distance(p2.first, p2.last) ||
!mystl::is_permutation(p1.first, p2.last, p2.first, p2.last))
return false;
f = p1.last;
}
return true;
}
只判断了other包含了该hashtable中所有的元素,应该继续判断该hashtable是否包含了other中所有的元素,互相包含才相等。
The text was updated successfully, but these errors were encountered: