👌 fix move constructor and move assignment

parent 0617bd24
...@@ -2185,9 +2185,6 @@ class basic_json ...@@ -2185,9 +2185,6 @@ class basic_json
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
: m_type(std::move(other.m_type)), : m_type(std::move(other.m_type)),
m_value(std::move(other.m_value)) m_value(std::move(other.m_value))
#if JSON_DIAGNOSTICS
, m_parent(other.m_parent)
#endif
{ {
// check that passed value is valid // check that passed value is valid
other.assert_invariant(); other.assert_invariant();
...@@ -2261,9 +2258,6 @@ class basic_json ...@@ -2261,9 +2258,6 @@ class basic_json
using std::swap; using std::swap;
swap(m_type, other.m_type); swap(m_type, other.m_type);
swap(m_value, other.m_value); swap(m_value, other.m_value);
#if JSON_DIAGNOSTICS
m_parent = other.m_parent;
#endif
assert_invariant(); assert_invariant();
return *this; return *this;
...@@ -3659,13 +3653,6 @@ class basic_json ...@@ -3659,13 +3653,6 @@ class basic_json
// fill up array with null values if given idx is outside range // fill up array with null values if given idx is outside range
if (idx >= m_value.array->size()) if (idx >= m_value.array->size())
{ {
#if JSON_DIAGNOSTICS
// remember array size before resizing
const auto previous_size = m_value.array->size();
#endif
m_value.array->resize(idx + 1);
#if JSON_DIAGNOSTICS #if JSON_DIAGNOSTICS
// set parent for values added above // set parent for values added above
for (auto i = previous_size; i <= idx; ++i) for (auto i = previous_size; i <= idx; ++i)
......
...@@ -18821,9 +18821,6 @@ class basic_json ...@@ -18821,9 +18821,6 @@ class basic_json
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
: m_type(std::move(other.m_type)), : m_type(std::move(other.m_type)),
m_value(std::move(other.m_value)) m_value(std::move(other.m_value))
#if JSON_DIAGNOSTICS
, m_parent(other.m_parent)
#endif
{ {
// check that passed value is valid // check that passed value is valid
other.assert_invariant(); other.assert_invariant();
...@@ -18897,9 +18894,6 @@ class basic_json ...@@ -18897,9 +18894,6 @@ class basic_json
using std::swap; using std::swap;
swap(m_type, other.m_type); swap(m_type, other.m_type);
swap(m_value, other.m_value); swap(m_value, other.m_value);
#if JSON_DIAGNOSTICS
m_parent = other.m_parent;
#endif
assert_invariant(); assert_invariant();
return *this; return *this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment