Skip to content

Commit

Permalink
VS2013 doesn't allow move ops to be =default
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyDonahue authored and hjmjohnson committed Mar 1, 2019
1 parent 433107f commit 00558b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/json/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,9 @@ Json::Value obj_value(Json::objectValue); // {}
public:
Comments() = default;
Comments(const Comments& that);
Comments(Comments&&) = default;
Comments(Comments&& that);
Comments& operator=(const Comments& that);
Comments& operator=(Comments&&) = default;
Comments& operator=(Comments&& that);
bool has(CommentPlacement slot) const;
String get(CommentPlacement slot) const;
void set(CommentPlacement slot, String s);
Expand Down
8 changes: 8 additions & 0 deletions src/lib_json/json_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1440,11 +1440,19 @@ bool Value::isObject() const { return type() == objectValue; }
Value::Comments::Comments(const Comments& that)
: ptr_{cloneUnique(that.ptr_)} {}

Value::Comments::Comments(Comments&& that)
: ptr_{std::move(that.ptr_)} {}

Value::Comments& Value::Comments::operator=(const Comments& that) {
ptr_ = cloneUnique(that.ptr_);
return *this;
}

Value::Comments& Value::Comments::operator=(Comments&& that) {
ptr_ = std::move(that.ptr_);
return *this;
}

bool Value::Comments::has(CommentPlacement slot) const {
return ptr_ && !(*ptr_)[slot].empty();
}
Expand Down

0 comments on commit 00558b3

Please sign in to comment.