@@ -21,13 +21,20 @@ ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
2121
2222template <typename T, typename Enable>
2323struct Converter {
24+ static_assert (!detail::is_same<T, char >::value,
25+ " type 'char' is not supported, use 'signed char', 'unsigned "
26+ " char' or another integer type instead" );
27+
2428 static void toJson (const T& src, JsonVariant dst) {
2529 // clang-format off
2630 convertToJson (src, dst); // Error here? See https://arduinojson.org/v7/unsupported-set/
2731 // clang-format on
2832 }
2933
3034 static T fromJson (JsonVariantConst src) {
35+ static_assert (!detail::is_same<T, char *>::value,
36+ " type 'char*' is not supported, use 'const char*' instead" );
37+
3138 // clang-format off
3239 T result; // Error here? See https://arduinojson.org/v7/non-default-constructible/
3340 convertFromJson (src, result); // Error here? See https://arduinojson.org/v7/unsupported-as/
@@ -36,6 +43,9 @@ struct Converter {
3643 }
3744
3845 static bool checkJson (JsonVariantConst src) {
46+ static_assert (!detail::is_same<T, char *>::value,
47+ " type 'char*' is not supported, use 'const char*' instead" );
48+
3949 T dummy = T ();
4050 // clang-format off
4151 return canConvertFromJson (src, dummy); // Error here? See https://arduinojson.org/v7/unsupported-is/
0 commit comments