Fixed compilation error when index is not an int (issue #381)

This commit is contained in:
Benoit Blanchon
2016-11-13 20:19:36 +01:00
parent 1ce16ce449
commit f28157cab7
5 changed files with 17 additions and 10 deletions

View File

@@ -77,8 +77,12 @@ class JsonVariantBase : public Internals::JsonPrintable<TImpl> {
// an object.
// Return JsonVariant::invalid() if the variant is not an object.
template <typename TString>
FORCE_INLINE const JsonObjectSubscript<TString> operator[](
const TString &key) const;
FORCE_INLINE
typename TypeTraits::EnableIf<Internals::StringFuncs<TString>::has_equals,
const JsonObjectSubscript<TString> >::type
operator[](const TString &key) const {
return asObject()[key];
}
private:
const TImpl *impl() const {