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 {
@@ -233,7 +233,12 @@ class JSON_API Value {
233
233
CZString (CZString&& other);
234
234
#endif
235
235
~CZString ();
236
- CZString& operator =(CZString other);
236
+ CZString& operator =(const CZString& other);
237
+
238
+ #if JSON_HAS_RVALUE_REFERENCES
239
+ CZString& operator =(CZString&& other);
240
+ #endif
241
+
237
242
bool operator <(CZString const & other) const ;
238
243
bool operator ==(CZString const & other) const ;
239
244
ArrayIndex index () const ;
@@ -322,12 +327,21 @@ Json::Value obj_value(Json::objectValue); // {}
322
327
323
328
// / Deep copy, then swap(other).
324
329
// / \note Over-write existing comments. To preserve comments, use #swapPayload().
325
- Value& operator =(Value other);
330
+ Value& operator =(const Value& other);
331
+ #if JSON_HAS_RVALUE_REFERENCES
332
+ Value& operator =(Value&& other);
333
+ #endif
334
+
326
335
// / Swap everything.
327
336
void swap (Value& other);
328
337
// / Swap values but leave comments and source offsets in place.
329
338
void swapPayload (Value& other);
330
339
340
+ // / copy everything.
341
+ void copy (const Value& other);
342
+ // / copy values but leave comments and source offsets in place.
343
+ void copyPayload (const Value& other);
344
+
331
345
ValueType type () const ;
332
346
333
347
// / Compare payload only, not comments etc.
@@ -438,6 +452,10 @@ Json::Value obj_value(Json::objectValue); // {}
438
452
// / Equivalent to jsonvalue[jsonvalue.size()] = value;
439
453
Value& append (const Value& value);
440
454
455
+ #if JSON_HAS_RVALUE_REFERENCES
456
+ Value& append (Value&& value);
457
+ #endif
458
+
441
459
// / Access an object value by name, create a null member if it does not exist.
442
460
// / \note Because of our implementation, keys are limited to 2^30 -1 chars.
443
461
// / Exceeding that will cause an exception.
0 commit comments