mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Make FixedArray
movable
This commit is contained in:
parent
77d7f715e3
commit
f79165cefe
Notes:
sideshowbarker
2024-07-16 19:57:55 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/f79165cefe Pull-request: https://github.com/SerenityOS/serenity/pull/19589 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/nico
1 changed files with 7 additions and 2 deletions
|
@ -89,8 +89,13 @@ public:
|
||||||
: m_storage(exchange(other.m_storage, nullptr))
|
: m_storage(exchange(other.m_storage, nullptr))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
// This function would violate the contract, as it would need to deallocate this FixedArray. As it also has no use case, we delete it.
|
|
||||||
FixedArray<T>& operator=(FixedArray<T>&&) = delete;
|
FixedArray<T>& operator=(FixedArray<T>&& other)
|
||||||
|
{
|
||||||
|
m_storage = other.m_storage;
|
||||||
|
other.m_storage = nullptr;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
~FixedArray()
|
~FixedArray()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue