mirror of
https://github.com/nlohmann/json.git
synced 2026-10-12 17:37:15 +00:00
♻️ split set_parent function
This commit is contained in:
4 files changed
+110
-114
No files matched your search
@@ -132,7 +132,7 @@ struct external_constructor<value_t::array>
|
||||
{
|
||||
j.m_type = value_t::array;
|
||||
j.m_value = arr;
|
||||
j.set_parent(j, true);
|
||||
j.set_parents();
|
||||
j.assert_invariant();
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ struct external_constructor<value_t::array>
|
||||
{
|
||||
j.m_type = value_t::array;
|
||||
j.m_value = std::move(arr);
|
||||
j.set_parent(j, true);
|
||||
j.set_parents();
|
||||
j.assert_invariant();
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ struct external_constructor<value_t::array>
|
||||
using std::end;
|
||||
j.m_type = value_t::array;
|
||||
j.m_value.array = j.template create<typename BasicJsonType::array_t>(begin(arr), end(arr));
|
||||
j.set_parent(j, true);
|
||||
j.set_parents();
|
||||
j.assert_invariant();
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ struct external_constructor<value_t::array>
|
||||
{
|
||||
std::copy(std::begin(arr), std::end(arr), j.m_value.array->begin());
|
||||
}
|
||||
j.set_parent(j, true);
|
||||
j.set_parents();
|
||||
j.assert_invariant();
|
||||
}
|
||||
};
|
||||
@@ -198,7 +198,7 @@ struct external_constructor<value_t::object>
|
||||
{
|
||||
j.m_type = value_t::object;
|
||||
j.m_value = obj;
|
||||
j.set_parent(j, true);
|
||||
j.set_parents();
|
||||
j.assert_invariant();
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ struct external_constructor<value_t::object>
|
||||
{
|
||||
j.m_type = value_t::object;
|
||||
j.m_value = std::move(obj);
|
||||
j.set_parent(j, true);
|
||||
j.set_parents();
|
||||
j.assert_invariant();
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ struct external_constructor<value_t::object>
|
||||
|
||||
j.m_type = value_t::object;
|
||||
j.m_value.object = j.template create<typename BasicJsonType::object_t>(begin(obj), end(obj));
|
||||
j.set_parent(j, true);
|
||||
j.set_parents();
|
||||
j.assert_invariant();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user