mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-05-03 15:58:22 +02:00
Merge pull request #736 from maxim-ky/master
Move the existing value to "removed" argument; removed is optional (could be nullptr)
This commit is contained in:
commit
07a324fb14
@ -1186,7 +1186,12 @@ bool Value::removeMember(const char* key, const char* cend, Value* removed)
|
|||||||
ObjectValues::iterator it = value_.map_->find(actualKey);
|
ObjectValues::iterator it = value_.map_->find(actualKey);
|
||||||
if (it == value_.map_->end())
|
if (it == value_.map_->end())
|
||||||
return false;
|
return false;
|
||||||
|
if (removed)
|
||||||
|
#if JSON_HAS_RVALUE_REFERENCES
|
||||||
|
*removed = std::move(it->second);
|
||||||
|
#else
|
||||||
*removed = it->second;
|
*removed = it->second;
|
||||||
|
#endif
|
||||||
value_.map_->erase(it);
|
value_.map_->erase(it);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user