@@ -77,17 +77,15 @@ class VariantRefBase : public VariantTag {
77
77
// https://arduinojson.org/v7/api/jsonvariant/set/
78
78
template <typename T>
79
79
bool set (const T& value) const {
80
- using TypeForConverter = conditional_t <IsStringLiteral<T>::value, T,
81
- remove_cv_t <remove_reference_t <T>>>;
82
- return doSet<Converter<TypeForConverter>>(value);
80
+ return getOrCreateImpl ().set (value);
83
81
}
84
82
85
83
// Copies the specified value.
86
84
// https://arduinojson.org/v7/api/jsonvariant/set/
87
85
template <typename T,
88
86
detail::enable_if_t <!detail::is_const<T>::value, int > = 0 >
89
87
bool set (T* value) const {
90
- return doSet<Converter<T*>> (value);
88
+ return getOrCreateImpl (). set (value);
91
89
}
92
90
93
91
// Returns the size of the array or object.
@@ -292,20 +290,6 @@ class VariantRefBase : public VariantTag {
292
290
const {
293
291
return getVariant ();
294
292
}
295
-
296
- template <typename TConverter, typename T>
297
- bool doSet (const T& value) const {
298
- return doSet<TConverter>(
299
- value, is_same<typename function_traits<
300
- decltype (&TConverter::toJson)>::return_type,
301
- bool >{});
302
- }
303
-
304
- template <typename TConverter, typename T>
305
- bool doSet (const T& value, false_type) const ;
306
-
307
- template <typename TConverter, typename T>
308
- bool doSet (const T& value, true_type) const ;
309
293
};
310
294
311
295
ARDUINOJSON_END_PRIVATE_NAMESPACE
0 commit comments