| 3662 | } |
| 3663 | |
| 3664 | bool Value::removeMember(const char* key, const char* cend, Value* removed) { |
| 3665 | if (type_ != objectValue) { |
| 3666 | return false; |
| 3667 | } |
| 3668 | CZString actualKey(key, static_cast<unsigned>(cend - key), |
| 3669 | CZString::noDuplication); |
| 3670 | ObjectValues::iterator it = value_.map_->find(actualKey); |
| 3671 | if (it == value_.map_->end()) |
| 3672 | return false; |
| 3673 | if (removed) |
| 3674 | #if JSON_HAS_RVALUE_REFERENCES |
| 3675 | *removed = std::move(it->second); |
| 3676 | #else |
| 3677 | *removed = it->second; |
| 3678 | #endif |
| 3679 | value_.map_->erase(it); |
| 3680 | return true; |
| 3681 | } |
| 3682 | bool Value::removeMember(const char* key, Value* removed) { |
| 3683 | return removeMember(key, key + strlen(key), removed); |
| 3684 | } |