mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:37:46 +00:00
AK: Provide swap() for HashTable
This commit is contained in:
parent
af20b9424f
commit
7f3f63dd92
1 changed files with 8 additions and 0 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue