Boost logo

Boost :

From: Eduardo Quintana (eduardo.quintana_at_[hidden])
Date: 2020-09-18 07:40:04

> > // i want speed
> > boost::json::parser< int > p_int;
> >
> > // i want accuracy
> > boost::json::parser< boost::multiprecision::cpp_int > p_infinity;
> By this example, can we assume you only care about this flexibility at
> parsing level and not necessarily in the DOM-like object
> (json::value)?

That what just for illustration purposes.
I see that there are several objects involved.

My point is: the concept of JSON is independent of the underlying
types used for representing strings and numbers.
That's, in my opinion, a strong suggestion for using templates,
and a solution to the "precision vs speed" conundrum.

Of course a json::parser<T>, has to produce a json::value<T>
and yet json::value<T> can exists independently of a json::parser<T>
or json::serializer<T>.
Is up to the developers to choose how the abstraction is implemented.

Anyways that was just a comment and a suggestion.
If I was writting a json library I would have used templates.


Boost list run by bdawes at, gregod at, cpdaniel at, john at