| 1221 | } |
| 1222 | |
| 1223 | bool Value::removeMember(const char* begin, const char* end, Value* removed) { |
| 1224 | if (type_ != objectValue) { |
| 1225 | return false; |
| 1226 | } |
| 1227 | CZString actualKey(begin, static_cast<unsigned>(end - begin), |
| 1228 | CZString::noDuplication); |
| 1229 | auto it = value_.map_->find(actualKey); |
| 1230 | if (it == value_.map_->end()) |
| 1231 | return false; |
| 1232 | if (removed) |
| 1233 | #if JSON_HAS_RVALUE_REFERENCES |
| 1234 | *removed = std::move(it->second); |
| 1235 | #else |
| 1236 | *removed = it->second; |
| 1237 | #endif |
| 1238 | value_.map_->erase(it); |
| 1239 | return true; |
| 1240 | } |
| 1241 | bool Value::removeMember(const char* key, Value* removed) { |
| 1242 | return removeMember(key, key + strlen(key), removed); |
| 1243 | } |