Skip to content

Commit

Permalink
Fix SFINAE
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekma committed Aug 27, 2020
1 parent 3dd608f commit 36baa0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wpiutil/src/main/native/cpp/json_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ SOFTWARE.
#include <clocale> // lconv, localeconv
#include <cmath> // labs, isfinite, isnan, signbit, ldexp
#include <locale> // locale
#include <type_traits>

#include "wpi/raw_ostream.h"

Expand Down Expand Up @@ -99,16 +100,15 @@ class json::serializer
*/
void dump_escaped(StringRef s, const bool ensure_ascii);

template <typename NumberType,
detail::enable_if_t<
std::is_same<NumberType, number_unsigned_t>::value, int> = 0>
template <
typename NumberType,
detail::enable_if_t<std::is_same_v<NumberType, uint64_t>, int> = 0>
bool is_negative_integer(NumberType x) {
return false;
}

template <typename NumberType,
detail::enable_if_t<
std::is_same<NumberType, number_integer_t>::value, int> = 0>
detail::enable_if_t<std::is_same_v<NumberType, int64_t>, int> = 0>
bool is_negative_integer(NumberType x) {
return x < 0;
}
Expand Down

0 comments on commit 36baa0e

Please sign in to comment.