Add util::hash_table::count for compatibility
All checks were successful
Run tests / Run tests (push) Successful in 7m36s

This commit is contained in:
Nikita Lisitsa 2026-07-07 13:11:19 +03:00
parent 664b1d613e
commit 34c1a92f0b

View file

@ -475,6 +475,12 @@ namespace psemek::util
return find(key) != end();
}
template <typename Key1>
std::size_t count(Key1 const & key) const
{
return contains(key) ? 1 : 0;
}
bool erase(iterator const & it)
{
impl_.erase(it.internal());
@ -606,6 +612,12 @@ namespace psemek::util
return find(key) != end();
}
template <typename Key1>
std::size_t count(Key1 const & key) const
{
return contains(key) ? 1 : 0;
}
bool erase(iterator const & it)
{
impl_.erase(it.internal());