diff --git a/libs/util/include/psemek/util/hash_table.hpp b/libs/util/include/psemek/util/hash_table.hpp index af9cf130..ba9f9937 100644 --- a/libs/util/include/psemek/util/hash_table.hpp +++ b/libs/util/include/psemek/util/hash_table.hpp @@ -115,6 +115,27 @@ namespace psemek::util , Equal(std::forward(k)) {} + hash_table_impl(hash_table_impl && other) + : Hash(std::move(other.hash())) + , Equal(std::move(other.equal())) + , storage_(std::move(other.storage_)) + { + other.storage_.capacity = 0; + other.size_ = 0; + } + + hash_table_impl & operator = (hash_table_impl && other) + { + if (this == &other) + return *this; + + storage_ = std::move(other.storage_); + size_ = other.size_; + other.storage_.capacity = 0; + other.size_ = 0; + return *this; + } + Hash const & hash() const { return *this; } Equal const & equal() const { return *this; }