From 7f3f63dd923cdd616196a3b6504ec6b170257467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dano=20Perni=C5=A1?= Date: Sat, 17 Oct 2020 14:44:59 +0200 Subject: AK: Provide swap() for HashTable --- AK/HashTable.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AK/HashTable.h b/AK/HashTable.h index cd53fb202b..63b37b04cc 100644 --- a/AK/HashTable.h +++ b/AK/HashTable.h @@ -133,6 +133,14 @@ public: return *this; } + friend void swap(HashTable& a, HashTable& b) noexcept + { + swap(a.m_buckets, b.m_buckets); + swap(a.m_size, b.m_size); + swap(a.m_capacity, b.m_capacity); + swap(a.m_deleted_count, b.m_deleted_count); + } + bool is_empty() const { return !m_size; } size_t size() const { return m_size; } size_t capacity() const { return m_capacity; } -- cgit v1.2.3