Add util::hash_table::count for compatibility
All checks were successful
Run tests / Run tests (push) Successful in 7m36s
All checks were successful
Run tests / Run tests (push) Successful in 7m36s
This commit is contained in:
parent
664b1d613e
commit
34c1a92f0b
1 changed files with 12 additions and 0 deletions
|
|
@ -475,6 +475,12 @@ namespace psemek::util
|
||||||
return find(key) != end();
|
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)
|
bool erase(iterator const & it)
|
||||||
{
|
{
|
||||||
impl_.erase(it.internal());
|
impl_.erase(it.internal());
|
||||||
|
|
@ -606,6 +612,12 @@ namespace psemek::util
|
||||||
return find(key) != end();
|
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)
|
bool erase(iterator const & it)
|
||||||
{
|
{
|
||||||
impl_.erase(it.internal());
|
impl_.erase(it.internal());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue