aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/PlainObjectBase.h
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-07-04 12:52:55 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-07-04 12:52:55 +0200
commitf36538049669a7efee57f2b1e3c60bf8bf3976bb (patch)
tree1a2194d24455a1cab7ff3c657f4b6fb21ec5d3da /Eigen/src/Core/PlainObjectBase.h
parent3a9f9faada5de3a13611d7543014c5ef503eff58 (diff)
Fix regression introduced by 3117036b80075390dbc46f60aa0d595e5a44661b
: Matrix<Scalar,1,1>(int) did not compile if Scalar is not constructible from int. Now this falls back to the (Index size) constructor.
Diffstat (limited to 'Eigen/src/Core/PlainObjectBase.h')
-rw-r--r--Eigen/src/Core/PlainObjectBase.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h
index b5b25ef70..ae5b342ce 100644
--- a/Eigen/src/Core/PlainObjectBase.h
+++ b/Eigen/src/Core/PlainObjectBase.h
@@ -692,7 +692,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
template<typename T>
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE void _init1(Index size, typename internal::enable_if<Base::SizeAtCompileTime!=1,T>::type* = 0)
+ EIGEN_STRONG_INLINE void _init1(Index size, typename internal::enable_if<Base::SizeAtCompileTime!=1 || !internal::is_convertible<T, Scalar>::value,T>::type* = 0)
{
EIGEN_STATIC_ASSERT(bool(NumTraits<T>::IsInteger),
FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED)
@@ -700,7 +700,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
}
template<typename T>
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE void _init1(const Scalar& val0, typename internal::enable_if<Base::SizeAtCompileTime==1,T>::type* = 0)
+ EIGEN_STRONG_INLINE void _init1(const Scalar& val0, typename internal::enable_if<Base::SizeAtCompileTime==1 && internal::is_convertible<T, Scalar>::value,T>::type* = 0)
{
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1)
m_storage.data()[0] = val0;