From 5a1db3097b17602b571efb54e011abd5f109184d Mon Sep 17 00:00:00 2001 From: lisyarus Date: Thu, 24 Aug 2023 18:50:40 +0300 Subject: [PATCH] Add util::hash_table::empty --- libs/util/include/psemek/util/hash_table.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/util/include/psemek/util/hash_table.hpp b/libs/util/include/psemek/util/hash_table.hpp index a2f88323..dc3d77e8 100644 --- a/libs/util/include/psemek/util/hash_table.hpp +++ b/libs/util/include/psemek/util/hash_table.hpp @@ -372,6 +372,11 @@ namespace psemek::util impl_.clear(); } + bool empty() + { + return impl_.size() == 0; + } + std::size_t size() const { return impl_.size(); @@ -432,6 +437,11 @@ namespace psemek::util return impl_.size(); } + bool empty() + { + return impl_.size() == 0; + } + private: detail::hash_table_impl, detail::pair_hash, detail::pair_equal> impl_; };