bug #1736: fix compilation issue with A(all,{1,2}).col(j) by implementing true compile-time "if" for block_evaluator<>::coeff(i)/coeffRef(i)

This commit is contained in:
Gael Guennebaud
2019-09-11 15:40:07 +02:00
parent 031f17117d
commit 747c6a51ca
3 changed files with 41 additions and 10 deletions

View File

@@ -63,6 +63,15 @@ typedef std::size_t UIntPtr;
struct true_type { enum { value = 1 }; };
struct false_type { enum { value = 0 }; };
template<bool Condition>
struct bool_constant;
template<>
struct bool_constant<true> : true_type {};
template<>
struct bool_constant<false> : false_type {};
template<bool Condition, typename Then, typename Else>
struct conditional { typedef Then type; };