From 7c99b38b7c34c5a031e347b81277e67ab9cfdd93 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Fri, 2 Aug 2013 19:59:43 +0200 Subject: Added move support for Matrix and Array. Added EIGEN_HAVE_RVALUE_REFERENCES define. Added move unit tests. Removed superfluous 'inline' declarations in DenseStorage. --- Eigen/src/Core/Array.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Eigen/src/Core/Array.h') diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 497efff66..3d0350834 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -124,6 +124,21 @@ class Array } #endif +#ifdef EIGEN_HAVE_RVALUE_REFERENCES + Array(Array&& other) + : Base(std::move(other)) + { + Base::_check_template_params(); + if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic) + Base::_set_noalias(other); + } + Array& operator=(Array&& other) + { + other.swap(*this); + return *this; + } +#endif + /** Constructs a vector or row-vector with given dimension. \only_for_vectors * * Note that this is only useful for dynamic-size vectors. For fixed-size vectors, -- cgit v1.2.3