⚗️ try to fix compilation issue

This commit is contained in:
Niels Lohmann 2023-05-20 12:26:57 +02:00
parent f7ad06e1b9
commit 6e74433139
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
2 changed files with 4 additions and 4 deletions

View File

@ -1212,11 +1212,11 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief move constructor /// @brief move constructor
/// @sa https://json.nlohmann.me/api/basic_json/basic_json/ /// @sa https://json.nlohmann.me/api/basic_json/basic_json/
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
: json_base_class_t(std::move(other)), : json_base_class_t(std::forward<json_base_class_t>(other)),
m_data(std::move(other.m_data)) m_data(std::move(other.m_data))
{ {
// check that passed value is valid // check that passed value is valid
other.assert_invariant(false); // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved) other.assert_invariant(false);
// invalidate payload // invalidate payload
other.m_data.m_type = value_t::null; other.m_data.m_type = value_t::null;

View File

@ -20428,11 +20428,11 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief move constructor /// @brief move constructor
/// @sa https://json.nlohmann.me/api/basic_json/basic_json/ /// @sa https://json.nlohmann.me/api/basic_json/basic_json/
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
: json_base_class_t(std::move(other)), : json_base_class_t(std::forward<json_base_class_t>(other)),
m_data(std::move(other.m_data)) m_data(std::move(other.m_data))
{ {
// check that passed value is valid // check that passed value is valid
other.assert_invariant(false); // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved) other.assert_invariant(false);
// invalidate payload // invalidate payload
other.m_data.m_type = value_t::null; other.m_data.m_type = value_t::null;