Fixed invalid application of 'sizeof' to incomplete type (closes #783)

This commit is contained in:
Benoit Blanchon
2018-07-18 20:19:22 +02:00
parent 9bbfbd0a6a
commit 2059d610a8
4 changed files with 84 additions and 69 deletions

View File

@ -111,17 +111,17 @@ inline typename enable_if<IsString<TString>::value,
template <typename TImpl>
template <typename TString>
inline typename enable_if<IsString<const TString *>::value,
JsonObjectSubscript<const TString *> >::type
JsonVariantSubscripts<TImpl>::operator[](const TString *key) {
inline typename enable_if<IsString<TString *>::value,
JsonObjectSubscript<TString *> >::type
JsonVariantSubscripts<TImpl>::operator[](TString *key) {
return impl()->template as<JsonObject>()[key];
}
template <typename TImpl>
template <typename TString>
inline typename enable_if<IsString<TString *>::value,
const JsonObjectSubscript<const TString *> >::type
JsonVariantSubscripts<TImpl>::operator[](const TString *key) const {
const JsonObjectSubscript<TString *> >::type
JsonVariantSubscripts<TImpl>::operator[](TString *key) const {
return impl()->template as<JsonObject>()[key];
}

View File

@ -57,17 +57,16 @@ class JsonVariantSubscripts {
// JsonObjectSubscript operator[](TKey);
// TKey = const char*, const char[N], const FlashStringHelper*
template <typename TString>
FORCE_INLINE typename enable_if<IsString<const TString *>::value,
JsonObjectSubscript<const TString *> >::type
operator[](const TString *key);
FORCE_INLINE typename enable_if<IsString<TString *>::value,
JsonObjectSubscript<TString *> >::type
operator[](TString *key);
//
// JsonObjectSubscript operator[](TKey);
// TKey = const char*, const char[N], const FlashStringHelper*
template <typename TString>
FORCE_INLINE
typename enable_if<IsString<TString *>::value,
const JsonObjectSubscript<const TString *> >::type
operator[](const TString *key) const;
FORCE_INLINE typename enable_if<IsString<TString *>::value,
const JsonObjectSubscript<TString *> >::type
operator[](TString *key) const;
private:
const TImpl *impl() const {