Fix util::hash_table inserting non-const pair
This commit is contained in:
parent
24d1f1e5bf
commit
1d20bd5a17
1 changed files with 10 additions and 0 deletions
|
|
@ -296,6 +296,11 @@ namespace psemek::util
|
||||||
{
|
{
|
||||||
return static_cast<Hash const &>(*this)(pair.first);
|
return static_cast<Hash const &>(*this)(pair.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::size_t operator()(std::pair<Key, Value> const & pair) const
|
||||||
|
{
|
||||||
|
return static_cast<Hash const &>(*this)(pair.first);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Key, typename Value, typename Equal>
|
template <typename Key, typename Value, typename Equal>
|
||||||
|
|
@ -320,6 +325,11 @@ namespace psemek::util
|
||||||
{
|
{
|
||||||
return static_cast<Equal const &>(*this)(pair1.first, pair2.first);
|
return static_cast<Equal const &>(*this)(pair1.first, pair2.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator()(std::pair<Key, Value> const & pair1, std::pair<Key const, Value> const & pair2) const
|
||||||
|
{
|
||||||
|
return static_cast<Equal const &>(*this)(pair1.first, pair2.first);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue