VS2013 doesn't allow move ops to be =default
diff --git a/include/json/value.h b/include/json/value.h
index 9a2d10d..a62f482 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -659,9 +659,9 @@
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);
diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp
index 7102f88..5ce0079 100644
--- a/src/lib_json/json_value.cpp
+++ b/src/lib_json/json_value.cpp
@@ -1440,11 +1440,19 @@
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();
}