Skip to content

Commit 899e51b

Browse files
committed
Fix comp_return_type
1 parent 9fd6261 commit 899e51b

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ namespace xsimd
223223
* comparison dispatchers *
224224
**************************/
225225

226-
template <class T>
226+
template <class T, class Enable = void>
227227
struct comp_return_type_impl;
228228

229229
template <>
@@ -232,44 +232,44 @@ namespace xsimd
232232
using type = uint8x16_t;
233233
};
234234

235-
template <>
236-
struct comp_return_type_impl<int8x16_t>
235+
template <class T>
236+
struct comp_return_type_impl<T, typename std::enable_if<std::is_same<T, int8x16_t>::value && !std::is_same<int8x16_t, uint8x16_t>::value>::type>
237237
{
238238
using type = uint8x16_t;
239239
};
240240

241-
template <>
242-
struct comp_return_type_impl<uint16x8_t>
241+
template <class T>
242+
struct comp_return_type_impl<T, typename std::enable_if<std::is_same<T, uint16x8_t>::value && !std::is_same<uint16x8_t, uint8x16_t>::value>::type>
243243
{
244244
using type = uint16x8_t;
245245
};
246246

247-
template <>
248-
struct comp_return_type_impl<int16x8_t>
247+
template <class T>
248+
struct comp_return_type_impl<T, typename std::enable_if<std::is_same<T, int16x8_t>::value && !std::is_same<int16x8_t, uint8x16_t>::value>::type>
249249
{
250250
using type = uint16x8_t;
251251
};
252252

253-
template <>
254-
struct comp_return_type_impl<uint32x4_t>
253+
template <class T>
254+
struct comp_return_type_impl<T, typename std::enable_if<std::is_same<T, uint32x4_t>::value && !std::is_same<uint32x4_t, uint8x16_t>::value>::type>
255255
{
256256
using type = uint32x4_t;
257257
};
258258

259-
template <>
260-
struct comp_return_type_impl<int32x4_t>
259+
template <class T>
260+
struct comp_return_type_impl<T, typename std::enable_if<std::is_same<T, int32x4_t>::value && !std::is_same<int32x4_t, uint8x16_t>::value>::type>
261261
{
262262
using type = uint32x4_t;
263263
};
264264

265-
template <>
266-
struct comp_return_type_impl<uint64x2_t>
265+
template <class T>
266+
struct comp_return_type_impl<T, typename std::enable_if<std::is_same<T, uint64x2_t>::value && !std::is_same<uint64x2_t, uint8x16_t>::value>::type>
267267
{
268268
using type = uint64x2_t;
269269
};
270270

271-
template <>
272-
struct comp_return_type_impl<int64x2_t>
271+
template <class T>
272+
struct comp_return_type_impl<T, typename std::enable_if<std::is_same<T, int64x2_t>::value && !std::is_same<int64x2_t, uint8x16_t>::value>::type>
273273
{
274274
using type = uint64x2_t;
275275
};

0 commit comments

Comments
 (0)