1
0
mirror of https://github.com/nlohmann/json synced 2024-11-25 05:10:05 +00:00

👌 clean operator[]

This commit is contained in:
Niels Lohmann 2021-01-08 11:29:28 +01:00
parent e4af1ddb18
commit d4a91b7445
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
2 changed files with 0 additions and 12 deletions

View File

@ -3669,13 +3669,7 @@ class basic_json
#endif
}
#if JSON_DIAGNOSTICS
reference result = m_value.array->operator[](idx);
result.m_parent = this;
return result;
#else
return m_value.array->operator[](idx);
#endif
}
JSON_THROW(type_error::create(305, diagnostics() + "cannot use operator[] with a numeric argument with " + std::string(type_name())));

View File

@ -20305,13 +20305,7 @@ class basic_json
#endif
}
#if JSON_DIAGNOSTICS
reference result = m_value.array->operator[](idx);
result.m_parent = this;
return result;
#else
return m_value.array->operator[](idx);
#endif
}
JSON_THROW(type_error::create(305, diagnostics() + "cannot use operator[] with a numeric argument with " + std::string(type_name())));