mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-10 23:21:47 +08:00
Enable Array(EigenBase<>) ctor for compatible scalar types only. This prevents nested arrays to look as being convertible from/to simple arrays.
(grafted from 9fbdf020597cd198e3686ca786172aec6f009db6 )
This commit is contained in:
parent
e0412f18fd
commit
79120a4c63
@ -231,10 +231,16 @@ class Array
|
|||||||
: Base(other)
|
: Base(other)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct PrivateType {};
|
||||||
|
public:
|
||||||
|
|
||||||
/** \sa MatrixBase::operator=(const EigenBase<OtherDerived>&) */
|
/** \sa MatrixBase::operator=(const EigenBase<OtherDerived>&) */
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
EIGEN_STRONG_INLINE Array(const EigenBase<OtherDerived> &other)
|
EIGEN_STRONG_INLINE Array(const EigenBase<OtherDerived> &other,
|
||||||
|
typename internal::enable_if<internal::is_convertible<typename OtherDerived::Scalar,Scalar>::value,
|
||||||
|
PrivateType>::type = PrivateType())
|
||||||
: Base(other.derived())
|
: Base(other.derived())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user