Hi all,
My recommendation is to ACCEPT Boost.JSON into Boost. Parsing and
serializing
JSON using a DOM representation is a common enough task to have a
specialized
library for it in Boost. Most other languages provide built-in support
for this task. I see Boost as the repository where I look at when the
standard doesn't provide me something it should, so having a DOM
JSON library in Boost is a must for me.
- What is your evaluation of the design?
Generally sound. I especially value its simplicity. Concretely:
1. The memory management model is extremely simple. I wonder if
storage_ptr could be moved somewhere else long term so other
libraries can use it.
2. Using concrete types for numbers (uint64_t/int64_t/double)
may not fit everyone's needs but will definitely fit most
and makes things easy.
I miss some way of accessing json::value from generic code,
but I understand visitation is currently in progress. As a user
I would also be satisfied with generic versions of get_xxx,
is_xxx and so on:
```cpp
json::value val = /* ... */
val.getjson::object() // or json::getjson::object(val)
```
I also miss some way of determining the location (line and column)
of parse errors. I don't know how this feature would interact with
performance though. Nice to have but not required for me.
I would have also liked `json::kind` be streamable, as it
makes logging/debugging easier in some contexts. Nothing I can't
live without, though.
Finally, I would also appreciate `json::string` have a
straightforward way to be converted to `std::string` (e.g.
by having a `to_std_string()` member function).
- What is your evaluation of the implementation?
I have just looked at the interface.
- What is your evaluation of the documentation?
The documentation is very good and detailed, nice work.
I would say the main point of improvement would be `basic_parser`,
as I had a hard time understanding when some of the callbacks
get called, especially the `on_xxx_part` ones. It would be also good
to know if accessing the `basic_parser` state (e.g. `depth()`) is allowed
from within the handler. And if it is, maybe passing the parser instance
at the beginning of the parse could be useful (e.g. in the
`on_document_begin`,
or in a separate hook).
Ideally I would like to see an example of `basic_parser` used to parse
a custom struct, if it's not excessively complex.
Also note that `basic_parser` docs say that it's defined in
`