diff --git a/src/json.hpp b/src/json.hpp index 78cc7093..dece61dc 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -113,10 +113,13 @@ template struct has_mapped_type { private: - template static char test(typename C::mapped_type*); - template static char (&test(...))[2]; + template + static int detect(U&&); + + static void detect(...); public: - static constexpr bool value = sizeof(test(0)) == 1; + static constexpr bool value = + std::is_integral()))>::value; }; /*! diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 61196844..4f8adfd3 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -113,10 +113,13 @@ template struct has_mapped_type { private: - template static char test(typename C::mapped_type*); - template static char (&test(...))[2]; + template + static int detect(U&&); + + static void detect(...); public: - static constexpr bool value = sizeof(test(0)) == 1; + static constexpr bool value = + std::is_integral()))>::value; }; /*!