AK: Support setting with non copyable keys in HashMap

This commit is contained in:
Idan Horowitz 2022-01-21 12:34:23 +02:00 committed by Andreas Kling
parent fdfdb5bd1c
commit 7356110033
Notes: sideshowbarker 2024-07-17 20:31:46 +09:00

View file

@ -50,8 +50,10 @@ public:
HashSetResult set(const K& key, const V& value) { return m_table.set({ key, value }); }
HashSetResult set(const K& key, V&& value) { return m_table.set({ key, move(value) }); }
HashSetResult set(K&& key, V&& value) { return m_table.set({ move(key), move(value) }); }
ErrorOr<HashSetResult> try_set(const K& key, const V& value) { return m_table.try_set({ key, value }); }
ErrorOr<HashSetResult> try_set(const K& key, V&& value) { return m_table.try_set({ key, move(value) }); }
ErrorOr<HashSetResult> try_set(K&& key, V&& value) { return m_table.try_set({ move(key), move(value) }); }
bool remove(const K& key)
{