Boost logo

Boost :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2020-06-17 01:27:50

On Mon, Jun 15, 2020 at 4:18 AM Andrzej Krzemienski <akrzemi1_at_[hidden]> wrote:
> can they use their string in Boost.JSON?

No. The design of the library explicitly avoids allowing customizability.

> It should be possible to parametrize Boost.JSON with the string type.

This has been explored in other libraries, and I don't like the
result. Here is nlohmann JSON's value type:

        template<typename, typename, typename...> class ObjectType,
        template<typename, typename...> class ArrayType,
        class StringType,
        class BooleanType,
        class NumberIntegerType,
        class NumberUnsignedType,
        class NumberFloatType,
        template<typename> class AllocatorType,
        template<typename, typename = void> class JSONSerializer
    class basic_json
        friend ::nlohmann::detail::parser<basic_json>;
        friend ::nlohmann::detail::serializer<basic_json>;


Thanks, but no thanks.

As I said the library achieves its performance partly due to the
layout of the different types used in the discriminated union, of
which string is one. Users aren't asking for "using their own string
type in the JSON DOM." What they want is the speed of RapidJSON,
options for skipping comments, allowing trailing commas, and flexible
parsing, and the interface quality of a Boost library.


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