dropbox / json11

A tiny JSON library for C++11.
MIT License
2.55k stars 613 forks source link

no const accessor & AddElement API #78

Closed ayoubserti closed 7 years ago

ayoubserti commented 7 years ago

I would like to have [] no const accessor to override existing element. Also it will be nice to have Json::AddElement to make it possible to add new element into Object/Array

artwyman commented 7 years ago

The Json type is immutable by design, so we don't want to add those methods. You can use a Json::object (typedef for a map) directly for mutating, and then build the final Json object after you're done. If you want something with more features than that, I think you'd want some sort of a separate JsonBuilder type.