is_valid_index_type issue with MSVC2017
Submitted by Gael Guennebaud
Assigned to Nobody
Link to original bugzilla bug (#1750)
Version: 3.4 (development)
Operating system: Windows
Description
Reported by Stepanas Kazys:
In XprHelper.h, the declaration of template<typename T> struct is_valid_index_type has three code paths based on pre-processor values for EIGEN_HAS_TYPE_TRAITS and EIGEN_COMP_MSVC.
The first code path EIGEN_HAS_TYPE_TRAITS uses internal:: is_integral<>. I propose this should be std::is_integral<> instead to better cover platform specific types.
In my use case, I am building with MSVC (Visual studio 15 2017) and I get a static assertion trip. The issue is with the declaration of EIGEN_DEFAULT_DENSE_INDEX_TYPE as std::ptrdiff_t. With MSVC, this type is underpinned by __int64, which is not covered by the internal type traits resulting in a static assertion failure in PlainObjectBase.h _init2().