mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
* Set parent pointers for values inserted via update() (fixes #3007). * Moved test for #3007 to proper file. * Enable access to private members in diagnostics unit tests. * Make style consistent with rest of code. * Forced amalgamate rerun. * Refactor test for #3007 so it doesn't use private members. Also extend to test both update() functions. * Added fix for #3007 to update(const_iterator, const_iterator) as well. * Added failing example code from #3007 as extra test.
This commit is contained in:
@ -23414,6 +23414,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
for (auto it = j.cbegin(); it != j.cend(); ++it)
|
||||
{
|
||||
m_value.object->operator[](it.key()) = it.value();
|
||||
#if JSON_DIAGNOSTICS
|
||||
m_value.object->operator[](it.key()).m_parent = this;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -23474,6 +23477,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
for (auto it = first; it != last; ++it)
|
||||
{
|
||||
m_value.object->operator[](it.key()) = it.value();
|
||||
#if JSON_DIAGNOSTICS
|
||||
m_value.object->operator[](it.key()).m_parent = this;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user