diff --git a/Eigen/src/Core/Visitor.h b/Eigen/src/Core/Visitor.h index 9116b9512..d6efb0495 100644 --- a/Eigen/src/Core/Visitor.h +++ b/Eigen/src/Core/Visitor.h @@ -86,11 +86,11 @@ template template void DenseBase::visit(Visitor& visitor) const { - const bool unroll = SizeAtCompileTime != Dynamic + enum { unroll = SizeAtCompileTime != Dynamic && CoeffReadCost != Dynamic && (SizeAtCompileTime == 1 || ei_functor_traits::Cost != Dynamic) && SizeAtCompileTime * CoeffReadCost + (SizeAtCompileTime-1) * ei_functor_traits::Cost - <= EIGEN_UNROLLING_LIMIT; + <= EIGEN_UNROLLING_LIMIT }; return ei_visitor_impl::run(derived(), visitor);