diff --git a/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp b/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp index d6c7016a..6fef3b20 100644 --- a/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp +++ b/src/ArduinoJson/Polyfills/type_traits/is_signed.hpp @@ -4,27 +4,14 @@ #pragma once -#include "integral_constant.hpp" -#include "is_same.hpp" #include "remove_cv.hpp" namespace ARDUINOJSON_NAMESPACE { -// clang-format off template -struct is_signed : integral_constant::type, char>::value || - is_same::type, signed char>::value || - is_same::type, signed short>::value || - is_same::type, signed int>::value || - is_same::type, signed long>::value || -#if ARDUINOJSON_HAS_LONG_LONG - is_same::type, signed long long>::value || -#endif -#if ARDUINOJSON_HAS_INT64 - is_same::type, signed __int64>::value || -#endif - is_same::type, float>::value || - is_same::type, double>::value> {}; -// clang-format on +struct is_signed { + typedef typename remove_cv::type type; + static const bool value = type(-1) < type(0); +}; + } // namespace ARDUINOJSON_NAMESPACE diff --git a/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp b/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp index 84b7d051..ad84433d 100644 --- a/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp +++ b/src/ArduinoJson/Polyfills/type_traits/is_unsigned.hpp @@ -4,25 +4,14 @@ #pragma once -#include "integral_constant.hpp" -#include "is_same.hpp" #include "remove_cv.hpp" namespace ARDUINOJSON_NAMESPACE { -// clang-format off template -struct is_unsigned : integral_constant::type, unsigned char>::value || - is_same::type, unsigned short>::value || - is_same::type, unsigned int>::value || - is_same::type, unsigned long>::value || -#if ARDUINOJSON_HAS_INT64 - is_same::type, unsigned __int64>::value || -#endif -#if ARDUINOJSON_HAS_LONG_LONG - is_same::type, unsigned long long>::value || -#endif - is_same::type, bool>::value> {}; -// clang-format on +struct is_unsigned { + typedef typename remove_cv::type type; + static const bool value = type(-1) > type(0); +}; + } // namespace ARDUINOJSON_NAMESPACE