Skip to content

Commit

Permalink
Fix overload of abs for char type (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed Apr 19, 2024
1 parent 7933df6 commit 0af8e20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/xsimd/arch/xsimd_scalar.hpp
Expand Up @@ -93,11 +93,15 @@ namespace xsimd

namespace detail
{
inline char abs(char v, std::true_type)
// Use templated type here to prevent automatic instantiation that may
// ends up in a warning
template <typename char_type>
inline char abs(char_type v, std::true_type)
{
return v;
}
inline char abs(char v, std::false_type)
template <typename char_type>
inline char abs(char_type v, std::false_type)
{
return v < 0 ? -v : v;
}
Expand Down

0 comments on commit 0af8e20

Please sign in to comment.