move ctors

* Add move constructor to Value::CZString
* Add unit test for Value move constructor
* Allow includer to specify in advance the value for
JSON_HAS_RVALUE_REFERENCES
This commit is contained in:
Motti
2015-04-20 17:44:47 +03:00
committed by Christopher Dunn
parent a4ce2829dc
commit 2b00891a86
4 changed files with 82 additions and 13 deletions

View File

@@ -212,6 +212,9 @@ private:
CZString(ArrayIndex index);
CZString(char const* str, unsigned length, DuplicationPolicy allocate);
CZString(CZString const& other);
#if JSON_HAS_RVALUE_REFERENCES
CZString(CZString&& other);
#endif
~CZString();
CZString& operator=(CZString other);
bool operator<(CZString const& other) const;
@@ -294,6 +297,10 @@ Json::Value obj_value(Json::objectValue); // {}
Value(bool value);
/// Deep copy.
Value(const Value& other);
#if JSON_HAS_RVALUE_REFERENCES
/// Move constructor
Value(Value&& other);
#endif
~Value();
/// Deep copy, then swap(other).