From 0d1fb383b7f4572a154d7a26a1318e2c617b4de8 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 14 Jan 2021 22:05:08 +0100 Subject: [PATCH] :ok_hand: address comment --- include/nlohmann/detail/conversions/to_json.hpp | 4 +--- single_include/nlohmann/json.hpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/nlohmann/detail/conversions/to_json.hpp b/include/nlohmann/detail/conversions/to_json.hpp index f42735e83..228e81879 100644 --- a/include/nlohmann/detail/conversions/to_json.hpp +++ b/include/nlohmann/detail/conversions/to_json.hpp @@ -167,9 +167,7 @@ struct external_constructor for (const bool x : arr) { j.m_value.array->push_back(x); -#if JSON_DIAGNOSTICS - j.m_value.array->back().m_parent = &j; -#endif + j.set_parent(j.m_value.array->back()); } j.assert_invariant(); } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 78375c5c0..4ed9994e2 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4337,9 +4337,7 @@ struct external_constructor for (const bool x : arr) { j.m_value.array->push_back(x); -#if JSON_DIAGNOSTICS - j.m_value.array->back().m_parent = &j; -#endif + j.set_parent(j.m_value.array->back()); } j.assert_invariant(); }