aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-01-24 11:36:43 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-01-24 11:36:43 +0100
commitc43d254d1376c24c76df45bb274dda74ddfa2e19 (patch)
treebc3176c35bb631d6d431a1ad576f8116c74c6e08
parent5783158e8f240418d33b0745b4276f9cc977be64 (diff)
Fix seq().reverse() in c++98
-rw-r--r--Eigen/src/Core/ArithmeticSequence.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/Eigen/src/Core/ArithmeticSequence.h b/Eigen/src/Core/ArithmeticSequence.h
index c5c8bb105..6c10ecc02 100644
--- a/Eigen/src/Core/ArithmeticSequence.h
+++ b/Eigen/src/Core/ArithmeticSequence.h
@@ -43,9 +43,20 @@ struct aseq_reverse_first_type<FirstType,SizeType,IncrType,true,true> {
> type;
};
+template<typename SizeType,typename IncrType,typename EnableIf = void>
+struct aseq_reverse_first_type_aux {
+ typedef Index type;
+};
+
+template<typename SizeType,typename IncrType>
+struct aseq_reverse_first_type_aux<SizeType,IncrType,typename internal::enable_if<bool((SizeType::value+IncrType::value)|0x1)>::type> {
+ typedef FixedInt<(SizeType::value-1)*IncrType::value> type;
+};
+
template<typename FirstType,typename SizeType,typename IncrType>
struct aseq_reverse_first_type<FirstType,SizeType,IncrType,true,false> {
- typedef Symbolic::AddExpr<FirstType,Symbolic::ValueExpr<> > type;
+ typedef typename aseq_reverse_first_type_aux<SizeType,IncrType>::type Aux;
+ typedef Symbolic::AddExpr<FirstType,Symbolic::ValueExpr<Aux> > type;
};
template<typename FirstType,typename SizeType,typename IncrType>