mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 03:04:57 +00:00
AK: Make FixedArray
movable
This commit is contained in:
parent
77d7f715e3
commit
f79165cefe
1 changed files with 7 additions and 2 deletions
|
@ -89,8 +89,13 @@ public:
|
|||
: 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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue