@@ -55,7 +55,7 @@ void EIGENPY_DLLAPI import_numpy();
5555int EIGENPY_DLLAPI PyArray_TypeNum (PyTypeObject* type);
5656
5757// By default, the Scalar is considered as a Python object
58- template <typename Scalar>
58+ template <typename Scalar, typename Enable = void >
5959struct NumpyEquivalentType {
6060 enum { type_code = NPY_USERDEF };
6161};
@@ -141,12 +141,16 @@ struct NumpyEquivalentType<unsigned long> {
141141
142142#include < type_traits>
143143
144- template <>
145- struct NumpyEquivalentType <std::enable_if<!std::is_same<int64_t , long long >::value, long long >::type> {
144+ template <typename Scalar>
145+ struct NumpyEquivalentType <Scalar, std::enable_if_t <
146+ !std::is_same<int64_t , long long >::value &&
147+ std::is_same<Scalar, long long >::value>> {
146148 enum { type_code = NPY_LONGLONG };
147149};
148- template <>
149- struct NumpyEquivalentType <std::enable_if<!std::is_same<uint64_t , unsigned long long >::value, unsigned long long >::type> {
150+ template <typename Scalar>
151+ struct NumpyEquivalentType <Scalar, std::enable_if_t <
152+ !std::is_same<uint64_t , unsigned long long >::value &&
153+ std::is_same<Scalar, unsigned long long >::value>> {
150154 enum { type_code = NPY_ULONGLONG };
151155};
152156
0 commit comments