diff --git a/libs/util/include/psemek/util/hash_table.hpp b/libs/util/include/psemek/util/hash_table.hpp index ae0d1acc..b947a866 100644 --- a/libs/util/include/psemek/util/hash_table.hpp +++ b/libs/util/include/psemek/util/hash_table.hpp @@ -475,6 +475,12 @@ namespace psemek::util return find(key) != end(); } + template + 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 + std::size_t count(Key1 const & key) const + { + return contains(key) ? 1 : 0; + } + bool erase(iterator const & it) { impl_.erase(it.internal());