To work with json using a library jsoncpp. Previously created an array of objects can be cleared by clear
.
Json::Value value;
...
value.clear();
Also, it can be purified by arrayValue
(or nullValue
).
Json::Value value;
...
value = Json::arrayValue;
Question: What's the difference between clear
and arrayValue
?
null, empty array, and empty object are three different things in JsonCpp.
value.clear()
does the following:
value = Json:arrayValue
does the following:
So the two constructs are not semantically equivalent.