From 760f54f993341b1b5bd02c8f3f875aa908b4ebca Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sun, 14 Apr 2024 12:01:20 +0200 Subject: [PATCH] :rotating_light: fix warning --- include/nlohmann/detail/conversions/from_json.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index 41146cd21..84b55f229 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -277,7 +277,7 @@ template < typename BasicJsonType, typename T, std::size_t... Idx > std::array from_json_inplace_array_impl(BasicJsonType&& j, identity_tag> /*unused*/, index_sequence /*unused*/) { - return { { j.at(Idx).template get < T&& > ()... } }; + return { { std::forward(j).at(Idx).template get < T&& > ()... } }; } template < typename BasicJsonType, typename T, std::size_t... Idx > diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 2db129e56..d88467d85 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4904,7 +4904,7 @@ template < typename BasicJsonType, typename T, std::size_t... Idx > std::array from_json_inplace_array_impl(BasicJsonType&& j, identity_tag> /*unused*/, index_sequence /*unused*/) { - return { { j.at(Idx).template get < T&& > ()... } }; + return { { std::forward(j).at(Idx).template get < T&& > ()... } }; } template < typename BasicJsonType, typename T, std::size_t... Idx >