basic implementation of context-based path traction
Very rough draft of the idea.
For a context type Ctx the user is supposed to implement these functions:
void tag_invoke(context_key_push_tag, string_view, Ctx const&);
void tag_invoke(context_key_pop_tag, Ctx const&);
void tag_invoke(context_index_push_tag, std::size_t, Ctx const&);
void tag_invoke(context_index_pop_tag, Ctx const&);
The library would invoke them when traversing through the converted/parsed/serialized value.
Things to think about:
- The user may actually want to set
error_codein those callbacks. - The user may want to clear
error_codein those functions. But then where would we get the results the calling function was supposed to create?
An automated preview of the documentation is available at https://1075.json.prtest2.cppalliance.org/libs/json/doc/html/index.html
Benchmark test results. More info at https://benchmark.cppalliance.org/jsonbenchmarks-pullrequests/1075/pullrequest.html
Is very interesting and clean. I would suggest in this section
https://github.com/grisumbras/json/blob/e4e192a84f7482aaad923575e34e6f37669252d0/include/boost/json/detail/value_to.hpp#L376
To move the json::context_key_push(ctx, D::name);
Before the check, so we can capture the "last processed" json pointer