Add missing non-template methods for hash table
This commit is contained in:
parent
99ca3ec2eb
commit
54fb90214f
1 changed files with 30 additions and 0 deletions
|
|
@ -493,6 +493,16 @@ namespace psemek::util
|
|||
return true;
|
||||
}
|
||||
|
||||
bool erase(T const & key)
|
||||
{
|
||||
if (auto it = find(key); it != end())
|
||||
{
|
||||
erase(it);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename Key>
|
||||
bool erase(Key const & key)
|
||||
{
|
||||
|
|
@ -581,12 +591,22 @@ namespace psemek::util
|
|||
return impl_.insert(std::move(value));
|
||||
}
|
||||
|
||||
iterator find(Key const & key) const
|
||||
{
|
||||
return impl_.find(key);
|
||||
}
|
||||
|
||||
template <typename Key1>
|
||||
iterator find(Key1 const & key) const
|
||||
{
|
||||
return impl_.find(key);
|
||||
}
|
||||
|
||||
bool contains(Key const & key) const
|
||||
{
|
||||
return find(key) != end();
|
||||
}
|
||||
|
||||
template <typename Key1>
|
||||
bool contains(Key1 const & key) const
|
||||
{
|
||||
|
|
@ -599,6 +619,16 @@ namespace psemek::util
|
|||
return true;
|
||||
}
|
||||
|
||||
bool erase(Key const & key)
|
||||
{
|
||||
if (auto it = find(key); it != end())
|
||||
{
|
||||
erase(it);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename Key1>
|
||||
bool erase(Key1 const & key)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue