From 4b35504160d7fc587c345487381330a297f74c25 Mon Sep 17 00:00:00 2001 From: Wankupi <2893353848@qq.com> Date: Mon, 26 Feb 2024 11:01:15 +0800 Subject: [PATCH] Revert "fix(vector): bugs of move constructor/assignment in supporting files." This reverts commit 5c9346830c06c56afde2ff613cdd33cf859e1c9c. --- vector/data/class-matrix.hpp | 4 ++-- vector/src/utility.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vector/data/class-matrix.hpp b/vector/data/class-matrix.hpp index ecf7559..ba57f72 100644 --- a/vector/data/class-matrix.hpp +++ b/vector/data/class-matrix.hpp @@ -41,7 +41,7 @@ public: Matrix(const Matrix<_Td> &mat) : n_rows(mat.n_rows), n_cols(mat.n_cols), data(mat.data) {} Matrix(Matrix<_Td> &&mat) noexcept - : n_rows(mat.n_rows), n_cols(mat.n_cols), data(std::move(mat.data)) {} + : n_rows(mat.n_rows), n_cols(mat.n_cols), data(mat.data) {} Matrix<_Td> & operator=(const Matrix<_Td> &rhs) { this->n_rows = rhs.n_rows; @@ -53,7 +53,7 @@ public: { this->n_rows = rhs.n_rows; this->n_cols = rhs.n_cols; - this->data = std::move(rhs.data); + this->data = rhs.data; return *this; } inline const size_t & RowSize() const diff --git a/vector/src/utility.hpp b/vector/src/utility.hpp index a36ef2e..4d13ee5 100644 --- a/vector/src/utility.hpp +++ b/vector/src/utility.hpp @@ -15,11 +15,11 @@ public: pair(pair &&other) = default; pair(const T1 &x, const T2 &y) : first(x), second(y) {} template - pair(U1 &&x, U2 &&y) : first(std::move(x)), second(std::move(y)) {} + pair(U1 &&x, U2 &&y) : first(x), second(y) {} template pair(const pair &other) : first(other.first), second(other.second) {} template - pair(pair &&other) : first(std::move(other.first)), second(std::move(other.second)) {} + pair(pair &&other) : first(other.first), second(other.second) {} }; }