From d43d51eedcc1778b8dbedcdcbc8dbf24dbe75390 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 7 May 2023 23:39:33 +0200 Subject: [PATCH] AK: Add FIXMEs to HashMap copy-construct and copy-assign This underlines that we still copy-construct and copy-assign HashMaps. Primarily, this makes it easier to develop towards OOM-safe(r) internal data structures, by providing a reminder (the FIXME) and an easy error- checking switch (just change it to "delete" to see some of the errors). --- AK/HashMap.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AK/HashMap.h b/AK/HashMap.h index 0baa5fe779..5cd71c110d 100644 --- a/AK/HashMap.h +++ b/AK/HashMap.h @@ -40,6 +40,11 @@ public: set(item.key, item.value); } + HashMap(HashMap const&) = default; // FIXME: Not OOM-safe! Use clone() instead. + HashMap(HashMap&& other) noexcept = default; + HashMap& operator=(HashMap const& other) = default; // FIXME: Not OOM-safe! Use clone() instead. + HashMap& operator=(HashMap&& other) noexcept = default; + [[nodiscard]] bool is_empty() const { return m_table.is_empty();