From 02b36e928fbdb96673ae28332387be37ab3ac68b Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 30 Mar 2021 10:46:00 +0200 Subject: [PATCH] :alembic: add forgotten forward --- include/nlohmann/json.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index c3f658f1f..07c41aa16 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -4267,7 +4267,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()), *this)); } - const auto it = m_value.object->find(key); + const auto it = m_value.object->find(std::forward(key)); if (it != m_value.object->end()) { m_value.object->erase(it); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index fd5a62c42..340ae7587 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -21170,7 +21170,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec JSON_THROW(type_error::create(307, "cannot use erase() with " + std::string(type_name()), *this)); } - const auto it = m_value.object->find(key); + const auto it = m_value.object->find(std::forward(key)); if (it != m_value.object->end()) { m_value.object->erase(it);