|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2023-02-07 13:50:42
Julien Blanc wrote:
> Le 2023-02-07 04:44, Peter Dimov via Boost a écrit :
>
> > In addition, it uses Boost.Describe to support C++ objects directly,
> > instead of some bespoke mechanism.
> >
> > One downside is that boost::json::value can't hold a lambda, so
> > lambdas are not supported.
>
> This raises another question. My current understanding is that the current
> process is:
>
> C++Object ---> Json representation (via describe) ---> Mustache
> rendering
>
> This means the mandatory creation of a json object. Is it only because
> json support as an input source is mandatory, and once you got it it is
> much simpler to use it, or are there other reasons which prevent doing
> the following:
>
> C++Object ---> Mustache rendering (via describe)
As-is, this would require the library to be templated with everything in
the header.
We've been thinking about a type `json::value_view` that is to `json::value`
what `string_view` is to `string` - a way to get a "reference" to a type
supported natively by `value_from` that looks like a `json::value` without
having to create a `json::value` temporary and copy everything.
We don't have agreement yet whether this type will be added to
Boost.JSON. If not, I'll need to implement it in Mustache.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk