From d4a91b7445e88d81730ca75a5905e514f58e9d05 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 8 Jan 2021 11:29:28 +0100 Subject: [PATCH] :ok_hand: clean operator[] --- include/nlohmann/json.hpp | 6 ------ single_include/nlohmann/json.hpp | 6 ------ 2 files changed, 12 deletions(-) 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())));