Skip to content

Commit be9dcb5

Browse files
Fix overload of abs for char type (part 2)
1 parent 7933df6 commit be9dcb5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/xsimd/arch/xsimd_scalar.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,15 @@ namespace xsimd
9393

9494
namespace detail
9595
{
96-
inline char abs(char v, std::true_type)
96+
// Use templated type here to prevent automatic instantiation that may
97+
// ends up in a warning
98+
template <typename char_type>
99+
inline char abs(char_type v, std::true_type)
97100
{
98101
return v;
99102
}
100-
inline char abs(char v, std::false_type)
103+
template <typename char_type>
104+
inline char abs(char_type v, std::false_type)
101105
{
102106
return v < 0 ? -v : v;
103107
}

0 commit comments

Comments
 (0)