From 22d3ee930eace3d89300a70b42ec3c9f112c8c0e Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 15 Mar 2024 18:57:27 +0100 Subject: [PATCH] :rotating_light: fix warning --- include/nlohmann/json.hpp | 6 +++--- single_include/nlohmann/json.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index f4d582f50..b25e130b8 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -1212,9 +1212,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief move constructor /// @sa https://json.nlohmann.me/api/basic_json/basic_json/ basic_json(basic_json&& other) noexcept - : json_base_class_t(std::forward(other)), - // check that passed value is valid (has to be done before moving) - m_data(std::move((other.assert_invariant(false), other.m_data))) + // check that passed value is valid (has to be done before forwarding) + : json_base_class_t((other.assert_invariant(false), std::forward(other))), + m_data(std::move(other.m_data)) { // invalidate payload other.m_data.m_type = value_t::null; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 546ea18d2..77183af12 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -20515,9 +20515,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief move constructor /// @sa https://json.nlohmann.me/api/basic_json/basic_json/ basic_json(basic_json&& other) noexcept - : json_base_class_t(std::forward(other)), - // check that passed value is valid (has to be done before moving) - m_data(std::move((other.assert_invariant(false), other.m_data))) + // check that passed value is valid (has to be done before forwarding) + : json_base_class_t((other.assert_invariant(false), std::forward(other))), + m_data(std::move(other.m_data)) { // invalidate payload other.m_data.m_type = value_t::null;