23
23
#endif
24
24
25
25
// Conditional NORETURN attribute on the throw functions would:
26
- // a) suppress false positives from static code analysis
26
+ // a) suppress false positives from static code analysis
27
27
// b) possibly improve optimization opportunities.
28
28
#if !defined(JSONCPP_NORETURN)
29
29
# if defined(_MSC_VER)
@@ -64,7 +64,7 @@ class JSON_API Exception : public std::exception {
64
64
/* * Exceptions which the user cannot easily avoid.
65
65
*
66
66
* E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
67
- *
67
+ *
68
68
* \remark derived from Json::Exception
69
69
*/
70
70
class JSON_API RuntimeError : public Exception {
@@ -75,7 +75,7 @@ class JSON_API RuntimeError : public Exception {
75
75
/* * Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
76
76
*
77
77
* These are precondition-violations (user bugs) and internal errors (our bugs).
78
- *
78
+ *
79
79
* \remark derived from Json::Exception
80
80
*/
81
81
class JSON_API LogicError : public Exception {
@@ -322,12 +322,21 @@ Json::Value obj_value(Json::objectValue); // {}
322
322
323
323
// / Deep copy, then swap(other).
324
324
// / \note Over-write existing comments. To preserve comments, use #swapPayload().
325
- Value& operator =(Value other);
325
+ Value& operator =(const Value& other);
326
+ #if JSON_HAS_RVALUE_REFERENCES
327
+ Value& operator =(Value&& other);
328
+ #endif
329
+
326
330
// / Swap everything.
327
331
void swap (Value& other);
328
332
// / Swap values but leave comments and source offsets in place.
329
333
void swapPayload (Value& other);
330
334
335
+ // / copy everything.
336
+ void copy (const Value& other);
337
+ // / copy values but leave comments and source offsets in place.
338
+ void copyPayload (const Value& other);
339
+
331
340
ValueType type () const ;
332
341
333
342
// / Compare payload only, not comments etc.
0 commit comments