News for hackers. Stuff that matters.
Re:JSON for Modern C++ version 3.10.0 by nikki93 on Thursday August 19, 2021 @01:25AM (#28230624)
Yeah the support for pointer / patch etc. is a definite plus. The customization point thing I tend to do with my own customization points, but it's pretty good if a bunch of libraries settle on a standard customization point (eg. I think serde in Rust has achieved that a bit due to the ecosystem there) (definitely want it to be static).

I didn't realize that about the array complexity. Can you not just initialize a JSON array of N elements in O(N) (conceding a `.reserve(N)` style call beforehand if required)? rapidjson is pretty good about that sort of thing, cJSON's arrays are linked list so I basically think of its performance as at a different level and it's mostly about compile time for me.

Re:JSON for Modern C++ version 3.10.0 by ephaeton on Thursday August 19, 2021 @01:37AM (#28230693)
I haven't found a way to do that. The only O(n) to-json-array way is using the initializer list constructor AFAICT.