summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-05-07 23:39:33 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-19 22:33:57 +0200
commitd43d51eedcc1778b8dbedcdcbc8dbf24dbe75390 (patch)
tree43954c2b9917aa5f522709883a35646890f156b1 /AK
parent12d1ddbde5a0748380f9ccc78307b4f2f8b27b42 (diff)
downloadserenity-d43d51eedcc1778b8dbedcdcbc8dbf24dbe75390.zip
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).
Diffstat (limited to 'AK')
-rw-r--r--AK/HashMap.h5
1 files changed, 5 insertions, 0 deletions
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();