Add move ctor for SeArray.
This commit is contained in:
1 parent
5c7cf222bd
commit
ef848d6876
2 files changed
+14
-1
No files matched your search
@@ -18,7 +18,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
SeArray(const SeArray & other) = delete;
|
SeArray(const SeArray & other) = delete;
|
||||||
SeArray(SeArray && other) = delete;
|
SeArray(SeArray && other) = default;
|
||||||
|
|
||||||
SeArray & operator=(const SeArray & other) = default;
|
SeArray & operator=(const SeArray & other) = default;
|
||||||
SeArray & operator=(SeArray && other) = default;
|
SeArray & operator=(SeArray && other) = default;
|
||||||
|
|||||||
@@ -326,3 +326,16 @@ TEST(SeArrayTests, MoveAssignTest)
|
|||||||
ASSERT_EQ(0, arr1[4]);
|
ASSERT_EQ(0, arr1[4]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(SeArrayTests, MoveConstructTest)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
SeArray<int32_t, 2> arr1;
|
||||||
|
arr1[0] = 0x11;
|
||||||
|
arr1[1] = 0x22;
|
||||||
|
|
||||||
|
SeArray<int32_t, 2> arr2(std::move(arr1));
|
||||||
|
ASSERT_EQ(0x11, arr2[0]);
|
||||||
|
ASSERT_EQ(0x22, arr2[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user