diff --git a/Chaos/Service/SeArray.hpp b/Chaos/Service/SeArray.hpp index 427dcf7..c8bf88e 100644 --- a/Chaos/Service/SeArray.hpp +++ b/Chaos/Service/SeArray.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace Chaos::Service { @@ -18,7 +19,12 @@ public: } SeArray(const SeArray & other) = delete; - SeArray(SeArray && other) = default; + + SeArray(SeArray && other) + { + Storage_ = std::move(other.Storage_); + other.EraseImpl(); + } SeArray & operator=(const SeArray & other) = default; SeArray & operator=(SeArray && other) = default; diff --git a/ChaosTests/Service/SeArrayTests.cpp b/ChaosTests/Service/SeArrayTests.cpp index 4a09120..3d6e33f 100644 --- a/ChaosTests/Service/SeArrayTests.cpp +++ b/ChaosTests/Service/SeArrayTests.cpp @@ -337,5 +337,8 @@ TEST(SeArrayTests, MoveConstructTest) SeArray arr2(std::move(arr1)); ASSERT_EQ(0x11, arr2[0]); ASSERT_EQ(0x22, arr2[1]); + + ASSERT_EQ(0, arr1[0]); + ASSERT_EQ(0, arr1[1]); } }