From 34c1a92f0be271815584400635dbc5462e0589ed Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 7 Jul 2026 13:11:19 +0300 Subject: [PATCH] Add util::hash_table::count for compatibility --- libs/util/include/psemek/util/hash_table.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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());