diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index ee0531b32..11c089020 100755 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -97,17 +97,19 @@ template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; -template struct is_integral { enum { value = false }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; +template struct is_integral { enum { value = false }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; template struct add_const { typedef const T type; }; template struct add_const { typedef T& type; }; diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 99d91f9da..52b89c0d6 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -49,6 +49,19 @@ template void basicStuff(const MatrixType& m) v1[r] = x; VERIFY_IS_APPROX(x, v1[r]); + // test fetching with various index types. + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + VERIFY_IS_APPROX( v1, v1); VERIFY_IS_NOT_APPROX( v1, 2*v1); VERIFY_IS_MUCH_SMALLER_THAN( vzero, v1);