Add support for std::integral_constant

This commit is contained in:
Gael Guennebaud
2017-01-24 16:28:12 +01:00
parent bc10201854
commit d83db761a2
3 changed files with 32 additions and 9 deletions

View File

@@ -83,6 +83,10 @@ public:
#else
FixedInt ( FixedInt<N> (*)() ) {}
#endif
#if EIGEN_HAS_CXX11
FixedInt(std::integral_constant<int,N>) {}
#endif
};
/** \internal
@@ -170,6 +174,10 @@ template<int N, int DynamicKey> struct cleanup_index_type<VariableAndFixedInt<N>
// If VariableAndFixedInt matches DynamicKey, then we turn it to a pure runtime-value (aka Index):
template<int DynamicKey> struct cleanup_index_type<VariableAndFixedInt<DynamicKey>, DynamicKey> { typedef Index type; };
#if EIGEN_HAS_CXX11
template<int N, int DynamicKey> struct cleanup_index_type<std::integral_constant<int,N>, DynamicKey> { typedef FixedInt<N> type; };
#endif
} // end namespace internal
#ifndef EIGEN_PARSED_BY_DOXYGEN