Fixed dangling reference in MemberProxy and ElementProxy (fixes #1120)

This commit is contained in:
Benoit Blanchon
2019-10-30 19:09:21 +01:00
parent ef63757b1a
commit 6da6f921cd
9 changed files with 88 additions and 33 deletions

View File

@@ -141,11 +141,10 @@ class JsonDocument : public Visitable {
// operator[](const std::string&)
// operator[](const String&)
template <typename TString>
FORCE_INLINE
typename enable_if<IsString<TString>::value,
MemberProxy<JsonDocument&, const TString&> >::type
operator[](const TString& key) {
return MemberProxy<JsonDocument&, const TString&>(*this, key);
FORCE_INLINE typename enable_if<IsString<TString>::value,
MemberProxy<JsonDocument&, TString> >::type
operator[](const TString& key) {
return MemberProxy<JsonDocument&, TString>(*this, key);
}
// operator[](char*)