From cfe315476f3633d2c9481a56bf6791a25f79f597 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 28 Sep 2015 15:51:00 +0200 Subject: [PATCH] Add PlainObjectBase copy ctor from PlainObjectBase and DenseBase objects. (manual backport from default branch, fix segfault when creating PlainObjectBase object, though such an usage is not recommended at all) --- Eigen/src/Core/PlainObjectBase.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index 8a3e4545a..ffd3a0601 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -437,6 +437,22 @@ class PlainObjectBase : public internal::dense_xpr_base::type } #endif + /** Copy constructor */ + EIGEN_STRONG_INLINE PlainObjectBase(const PlainObjectBase& other) + : m_storage() + { + _check_template_params(); + lazyAssign(other); + } + + template + EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase &other) + : m_storage() + { + _check_template_params(); + lazyAssign(other); + } + EIGEN_STRONG_INLINE PlainObjectBase(Index a_size, Index nbRows, Index nbCols) : m_storage(a_size, nbRows, nbCols) {