From 9fbdf020597cd198e3686ca786172aec6f009db6 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 12 Jun 2017 22:30:32 +0200 Subject: Enable Array(EigenBase<>) ctor for compatible scalar types only. This prevents nested arrays to look as being convertible from/to simple arrays. --- Eigen/src/Core/Array.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Core/Array.h') diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 0d34269fd..e10020d4f 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -231,10 +231,16 @@ class Array : Base(other) { } + private: + struct PrivateType {}; + public: + /** \sa MatrixBase::operator=(const EigenBase&) */ template EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE Array(const EigenBase &other) + EIGEN_STRONG_INLINE Array(const EigenBase &other, + typename internal::enable_if::value, + PrivateType>::type = PrivateType()) : Base(other.derived()) { } -- cgit v1.2.3