I noticed the implementation for the equality operator for the hash_storage only compares the keys, but not the values of the maps. Is there any reason for this?
Current:
bool operator==(hash_storage const& b) const noexcept
{
if (size() != b.size()) {
return false;
}
for (auto const& el : *this) {
if (b.find(GetKey()(el)) == b.end()) {
return false;
}
}
return true;
}
Suggested change:
auto it = b.find(GetKey()(el));
if (it == b.end() || GetValue()(el) != it->second) {
return false;
}
I noticed the implementation for the equality operator for the
hash_storage
only compares the keys, but not the values of the maps. Is there any reason for this?Current:
Suggested change: