1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 11:00:46 +00:00

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).
This commit is contained in:
Ben Wiederhake 2023-05-07 23:39:33 +02:00 committed by Jelle Raaijmakers
parent 12d1ddbde5
commit d43d51eedc

View File

@ -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();