From 274c24c26295735011df381df5fb270e59b378c1 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 23 Feb 2013 20:13:21 +0100 Subject: Avoid problematic ternary operator (http://forum.kde.org/viewtopic.php?f=74&t=109486) --- Eigen/src/Core/SelfCwiseBinaryOp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Core/SelfCwiseBinaryOp.h') diff --git a/Eigen/src/Core/SelfCwiseBinaryOp.h b/Eigen/src/Core/SelfCwiseBinaryOp.h index 0caf2bab1..22f3047b4 100644 --- a/Eigen/src/Core/SelfCwiseBinaryOp.h +++ b/Eigen/src/Core/SelfCwiseBinaryOp.h @@ -185,7 +185,10 @@ inline Derived& DenseBase::operator/=(const Scalar& other) internal::scalar_product_op >::type BinOp; typedef typename Derived::PlainObject PlainObject; SelfCwiseBinaryOp tmp(derived()); - tmp = PlainObject::Constant(rows(),cols(), NumTraits::IsInteger ? other : Scalar(1)/other); + Scalar actual_other; + if(NumTraits::IsInteger) actual_other = other; + else actual_other = Scalar(1)/other; + tmp = PlainObject::Constant(rows(),cols(), actual_other); return derived(); } -- cgit v1.2.3