From 7633a21e6c1f2330743a8dc3a824e3144be76e1d Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 15 Jan 2021 16:58:05 +0100 Subject: [PATCH] :green_heart: fix build --- include/nlohmann/json.hpp | 2 ++ single_include/nlohmann/json.hpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 16bf6af00..af54f1b16 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3609,8 +3609,10 @@ class basic_json #endif m_value.array->resize(idx + 1); +#if JSON_DIAGNOSTICS // set parent for values added above set_parents(begin() + previous_size, idx + 1 - previous_size); +#endif } return m_value.array->operator[](idx); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 7617b8eda..ab3d857c2 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -20364,8 +20364,10 @@ class basic_json #endif m_value.array->resize(idx + 1); +#if JSON_DIAGNOSTICS // set parent for values added above set_parents(begin() + previous_size, idx + 1 - previous_size); +#endif } return m_value.array->operator[](idx);