Closed Lunewcome closed 8 years ago
The Json type is intended to be an immutable value type, which has a number of advantages including thread safety and the ability to share data across copies. If you want a mutable array you can use a Json::array (which is just a typedef for a vector) and mutate it freely before putting it into a Json object.
The copy constructor in json11.h is like this : "const Value & operator[](size_t i) const" So user can not update an array by "[]", for example : obj["array"][0] = a_json_value; Why is it designed like this?