mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-14 23:07:55 +02:00
This commit is contained in:
@@ -406,11 +406,11 @@ Value::~Value() {
|
||||
}
|
||||
|
||||
Value& Value::operator=(Value other) {
|
||||
swap(other);
|
||||
swapPayload(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Value::swap(Value& other) {
|
||||
void Value::swapPayload(Value& other) {
|
||||
ValueType temp = type_;
|
||||
type_ = other.type_;
|
||||
other.type_ = temp;
|
||||
@@ -418,6 +418,11 @@ void Value::swap(Value& other) {
|
||||
int temp2 = allocated_;
|
||||
allocated_ = other.allocated_;
|
||||
other.allocated_ = temp2;
|
||||
}
|
||||
|
||||
void Value::swap(Value& other) {
|
||||
swapPayload(other);
|
||||
std::swap(comments_, other.comments_);
|
||||
std::swap(start_, other.start_);
|
||||
std::swap(limit_, other.limit_);
|
||||
}
|
||||
|
Reference in New Issue
Block a user