Value::removeMember arg "removed" is optional now (could be nullptr)

This commit is contained in:
Maxim Ky 2018-01-29 16:59:24 +03:00
parent c27936e0aa
commit 1ec85c76a4

View File

@ -1186,10 +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 (removed)
#if JSON_HAS_RVALUE_REFERENCES
*removed = std::move(it->second);
*removed = std::move(it->second);
#else
*removed = it->second;
*removed = it->second;
#endif
value_.map_->erase(it);
return true;