🚨 fix warning

This commit is contained in:
Niels Lohmann committed 2024-03-15 19:24:59 +01:00
1 parent 22d3ee930e
commit 91be9e0175
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -1214,11 +1214,11 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
// check that passed value is valid (has to be done before forwarding) // check that passed value is valid (has to be done before forwarding)
: json_base_class_t((other.assert_invariant(false), std::forward<json_base_class_t>(other))), : json_base_class_t((other.assert_invariant(false), std::forward<json_base_class_t>(other))),
m_data(std::move(other.m_data)) m_data(std::move(other.m_data))// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
{ {
// invalidate payload // invalidate payload
other.m_data.m_type = value_t::null; other.m_data.m_type = value_t::null; // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
other.m_data.m_value = {}; other.m_data.m_value = {};// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
set_parents(); set_parents();
assert_invariant(); assert_invariant();
+3 -3
View File
@@ -20517,11 +20517,11 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
// check that passed value is valid (has to be done before forwarding) // check that passed value is valid (has to be done before forwarding)
: json_base_class_t((other.assert_invariant(false), std::forward<json_base_class_t>(other))), : json_base_class_t((other.assert_invariant(false), std::forward<json_base_class_t>(other))),
m_data(std::move(other.m_data)) m_data(std::move(other.m_data))// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
{ {
// invalidate payload // invalidate payload
other.m_data.m_type = value_t::null; other.m_data.m_type = value_t::null; // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
other.m_data.m_value = {}; other.m_data.m_value = {};// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
set_parents(); set_parents();
assert_invariant(); assert_invariant();