From c27936e0aab4e4b86fec59af41d50adc28d18dc1 Mon Sep 17 00:00:00 2001 From: Maxim Ky Date: Mon, 29 Jan 2018 16:58:45 +0300 Subject: [PATCH] Value::removeMember moves the existing value to "removed" now --- src/lib_json/json_value.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 30449fd..3a572ee 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -1186,7 +1186,11 @@ bool Value::removeMember(const char* key, const char* cend, Value* removed) ObjectValues::iterator it = value_.map_->find(actualKey); if (it == value_.map_->end()) return false; +#if JSON_HAS_RVALUE_REFERENCES + *removed = std::move(it->second); +#else *removed = it->second; +#endif value_.map_->erase(it); return true; }