aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src/AutoDiff
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-03-08 16:16:53 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-03-08 16:16:53 +0100
commit970ff78294503896940fb760d948f1eed156250f (patch)
treeca67c49aeccd18fe958f823d33a3b05e004234a1 /unsupported/Eigen/src/AutoDiff
parente5156e4d253fcc8ac13b0131973de3f56e810ab5 (diff)
bug #1401: fix compilation of "cond ? x : -x" with x an AutoDiffScalar
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff')
-rwxr-xr-xunsupported/Eigen/src/AutoDiff/AutoDiffScalar.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
index 50fedf6ac..d2808860c 100755
--- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
+++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
@@ -108,7 +108,9 @@ class AutoDiffScalar
template<typename OtherDerType>
AutoDiffScalar(const AutoDiffScalar<OtherDerType>& other
#ifndef EIGEN_PARSED_BY_DOXYGEN
- , typename internal::enable_if<internal::is_same<Scalar, typename internal::traits<typename internal::remove_all<OtherDerType>::type>::Scalar>::value,void*>::type = 0
+ , typename internal::enable_if<
+ internal::is_same<Scalar, typename internal::traits<typename internal::remove_all<OtherDerType>::type>::Scalar>::value
+ && internal::is_convertible<OtherDerType,DerType>::value , void*>::type = 0
#endif
)
: m_value(other.value()), m_derivatives(other.derivatives())