diff --git a/src/json.hpp b/src/json.hpp index 04c8573f..57fecf99 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -112,10 +112,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 48224835..e26ac7c7 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -112,10 +112,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; }; /*!