We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65ab59d commit e7cf44dCopy full SHA for e7cf44d
include/json.hpp
@@ -75,6 +75,14 @@ namespace json
75
* @param other The json object to be copied.
76
*/
77
json(const json &other) : value(other.value) {}
78
+ /**
79
+ * @brief Move constructor for the json class.
80
+ *
81
+ * This constructor transfers ownership of the value from another json object to the new json object.
82
83
+ * @param other The json object to be moved.
84
+ */
85
+ json(json &&other) noexcept : value(std::move(other.value)) { other.value = nullptr; }
86
87
/**
88
* @brief Constructs a JSON object from a value of type T.
0 commit comments