Erase the source SeArray immediately in move assignment operator.

This commit is contained in:
hashlag committed 2026-10-18 02:40:52 +03:00
1 parent fc67ba6b46
commit 0be43c9cf6
2 files changed
+23 -1

No files matched your search

+14 -1
View File
@@ -27,7 +27,20 @@ public:
}
SeArray & operator=(const SeArray & other) = default;
SeArray & operator=(SeArray && other) = default;
SeArray & operator=(SeArray && other)
{
if (this == &other)
{
return *this;
}
EraseImpl();
Storage_ = std::move(other.Storage_);
other.EraseImpl();
return *this;
}
~SeArray()
{