diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 8318013c7..38bab3806 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -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()))); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index c17457dc2..2e9768f77 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -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())));