File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,25 @@ cppjson::JsonObject::JsonObject(JsonObject&& other)
19
19
this ->_dataType = std::exchange (other._dataType , cppjson::JsonType::Null);
20
20
this ->_dataStorage = std::exchange (other._dataStorage , ::operator new (DataStorageSize));
21
21
}
22
-
22
+ cppjson::JsonObject& cppjson::JsonObject::operator =(const cppjson::JsonObject& other)
23
+ {
24
+ if (&other != this )
25
+ {
26
+ this ->_dataType = other._dataType ;
27
+ this ->_dataStorage = ::operator new (DataStorageSize);
28
+ std::memcpy (this ->_dataStorage , other._dataStorage , DataStorageSize);
29
+ }
30
+ return *this ;
31
+ }
32
+ cppjson::JsonObject& cppjson::JsonObject::operator =(cppjson::JsonObject&& other)
33
+ {
34
+ if (&other != this )
35
+ {
36
+ this ->_dataType = std::exchange (other._dataType , cppjson::JsonType::Null);
37
+ this ->_dataStorage = std::exchange (other._dataStorage , ::operator new (DataStorageSize));
38
+ }
39
+ return *this ;
40
+ }
23
41
cppjson::JsonObject::~JsonObject ()
24
42
{
25
43
this ->Destroy ();
You can’t perform that action at this time.
0 commit comments