@@ -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};
@@ -139,12 +139,19 @@ struct NumpyEquivalentType<unsigned long> {
139139// See https://github.com/stack-of-tasks/eigenpy/pull/455
140140#if defined __linux__
141141
142- template <>
143- struct NumpyEquivalentType <long long > {
142+ #include < type_traits>
143+
144+ template <typename Scalar>
145+ struct NumpyEquivalentType <
146+ Scalar, std::enable_if_t <!std::is_same<int64_t , long long >::value &&
147+ std::is_same<Scalar, long long >::value> > {
144148 enum { type_code = NPY_LONGLONG };
145149};
146- template <>
147- struct NumpyEquivalentType <unsigned long long > {
150+ template <typename Scalar>
151+ struct NumpyEquivalentType <
152+ Scalar,
153+ std::enable_if_t <!std::is_same<uint64_t , unsigned long long >::value &&
154+ std::is_same<Scalar, unsigned long long >::value> > {
148155 enum { type_code = NPY_ULONGLONG };
149156};
150157
0 commit comments