Skip to content

Commit 00558b3

Browse files
BillyDonahuehjmjohnson
authored andcommitted
VS2013 doesn't allow move ops to be =default
1 parent 433107f commit 00558b3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

include/json/value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,9 @@ Json::Value obj_value(Json::objectValue); // {}
659659
public:
660660
Comments() = default;
661661
Comments(const Comments& that);
662-
Comments(Comments&&) = default;
662+
Comments(Comments&& that);
663663
Comments& operator=(const Comments& that);
664-
Comments& operator=(Comments&&) = default;
664+
Comments& operator=(Comments&& that);
665665
bool has(CommentPlacement slot) const;
666666
String get(CommentPlacement slot) const;
667667
void set(CommentPlacement slot, String s);

src/lib_json/json_value.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,11 +1440,19 @@ bool Value::isObject() const { return type() == objectValue; }
14401440
Value::Comments::Comments(const Comments& that)
14411441
: ptr_{cloneUnique(that.ptr_)} {}
14421442

1443+
Value::Comments::Comments(Comments&& that)
1444+
: ptr_{std::move(that.ptr_)} {}
1445+
14431446
Value::Comments& Value::Comments::operator=(const Comments& that) {
14441447
ptr_ = cloneUnique(that.ptr_);
14451448
return *this;
14461449
}
14471450

1451+
Value::Comments& Value::Comments::operator=(Comments&& that) {
1452+
ptr_ = std::move(that.ptr_);
1453+
return *this;
1454+
}
1455+
14481456
bool Value::Comments::has(CommentPlacement slot) const {
14491457
return ptr_ && !(*ptr_)[slot].empty();
14501458
}

0 commit comments

Comments
 (0)