Skip to content

Commit

Permalink
Fix SFINAE?
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendanKKrueger committed Nov 20, 2024
1 parent 47a720f commit 956ccc8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ports-of-call/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ using std::data;
using std::size;

// type-safe check against 0 (prevents warnings about comparing an unsigned against 0)
template <typename T>
PORTABLE_FUNCTION constexpr std::enable_if_t<std::is_unsigned<T>::value>
check_nonnegative(const T)
template <typename T,
std::enable_if_t<std::is_unsigned<T>::value, bool> = true>
PORTABLE_FUNCTION constexpr bool check_nonnegative(const T)
{
return true;
}
template <typename T>
PORTABLE_FUNCTION constexpr std::enable_if_t<!std::is_unsigned<T>::value>
check_nonnegative([[maybe_unused]] const T t)
template <typename T,
std::enable_if_t<!std::is_unsigned<T>::value, bool> = true>
PORTABLE_FUNCTION constexpr bool check_nonnegative(const T t)
{
return t >= 0;
}
Expand Down

0 comments on commit 956ccc8

Please sign in to comment.