Przeglądaj źródła

Fix `no instance of overloaded function...` on IAR (fixes #2001)

Benoit Blanchon 2 lat temu
rodzic
commit
6ed87029e2
2 zmienionych plików z 3 dodań i 1 usunięć
  1. 1 0
      CHANGELOG.md
  2. 2 1
      src/ArduinoJson/Variant/VariantRefBase.hpp

+ 1 - 0
CHANGELOG.md

@@ -6,6 +6,7 @@ HEAD
 
 * Fix error `'std::string' has not been declared` (issue #1967)
 * Fix error `'std::string_view' has not been declared` (issue #1967)
+* Fix error `no instance of overloaded function...` on recent IAR compilers (issue #2001)
 
 v6.21.3 (2023-07-23)
 -------

+ 2 - 1
src/ArduinoJson/Variant/VariantRefBase.hpp

@@ -61,7 +61,8 @@ class VariantRefBase : public VariantTag {
     return Converter<T>::fromJson(getVariant());
   }
 
-  template <typename T>
+  template <typename T,
+            typename = typename enable_if<!is_same<T, TDerived>::value>::type>
   FORCE_INLINE operator T() const {
     return as<T>();
   }