mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-08 22:21:49 +08:00
std::integral_constant is not C++03 compatible
This commit is contained in:
parent
1b7294f6fc
commit
0c9ad2f525
@ -36,14 +36,16 @@ inline IndexDest convert_index(const IndexSrc& idx) {
|
|||||||
|
|
||||||
// true if T can be considered as an integral index (i.e., and integral type or enum)
|
// true if T can be considered as an integral index (i.e., and integral type or enum)
|
||||||
template<typename T> struct is_valid_index_type
|
template<typename T> struct is_valid_index_type
|
||||||
: std::integral_constant<bool,
|
{
|
||||||
|
enum { value =
|
||||||
#if EIGEN_HAS_TYPE_TRAITS
|
#if EIGEN_HAS_TYPE_TRAITS
|
||||||
internal::is_integral<T>::value || std::is_enum<T>::value
|
internal::is_integral<T>::value || std::is_enum<T>::value
|
||||||
#else
|
#else
|
||||||
// without C++11, we use is_convertible to Index instead of is_integral in order to treat enums as Index.
|
// without C++11, we use is_convertible to Index instead of is_integral in order to treat enums as Index.
|
||||||
internal::is_convertible<T,Index>::value
|
internal::is_convertible<T,Index>::value
|
||||||
#endif
|
#endif
|
||||||
> {};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// promote_scalar_arg is an helper used in operation between an expression and a scalar, like:
|
// promote_scalar_arg is an helper used in operation between an expression and a scalar, like:
|
||||||
// expression * scalar
|
// expression * scalar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user