Fixed ambiguous overload with JsonArraySubscript and JsonObjectSubscript (issue #122)

This commit is contained in:
Benoit Blanchon
2015-09-28 22:14:50 +02:00
parent d5e25b12b8
commit c6a4bfa886
25 changed files with 749 additions and 329 deletions

View File

@ -8,6 +8,11 @@
#include "JsonSubscriptBase.hpp"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
namespace ArduinoJson {
template <typename TKey>
@ -19,6 +24,17 @@ class JsonObjectSubscript
using JsonSubscriptBase<JsonObjectSubscript<TKey> >::operator=;
JsonObjectSubscript<TKey>& operator=(const JsonObjectSubscript<TKey>& src) {
return JsonSubscriptBase<JsonObjectSubscript<TKey> >::template assign<
JsonVariant>(src);
}
template <typename T>
JsonObjectSubscript<TKey>& operator=(const T& src) {
return JsonSubscriptBase<JsonObjectSubscript<TKey> >::template assign<
JsonVariant>(src);
}
FORCE_INLINE bool success() const { return _object.containsKey(_key); }
FORCE_INLINE operator JsonVariant() const { return _object.get(_key); }
@ -60,4 +76,8 @@ inline std::ostream& operator<<(
return source.printTo(os);
}
#endif
}
} // namespace ArduinoJson
#ifdef _MSC_VER
#pragma warning(pop)
#endif