Boost logo

Boost :

From: Ruben Perez (rubenperez038_at_[hidden])
Date: 2023-02-08 11:48:55


> > Conceptually, you should only require a map of names onto texts.
> > But json::value allows too much. According to the specs, the following should
> > is valid:
> >
> > boost::mustache::render( html, std::cout, ref,
> > { {"header", header}, {"footer", 1}, {"item", true}, {"body", nullptr} } );
> >
> > But it shouldn't be valid. Or amI wrong?
>
> The specification doesn't really say what happens when the partial isn't a string.
> I haven't checked what other implementations do in this case.

For reference, the JS implementation will just throw an error
(they don't test that case ;)).
Reading their code, their partials has a type equivalent to:

variant<
    map<string, string>,
    function<string(string)>
>

I support the idea of getting rid of json::value for partials
and get something more constrained.

Regards,
Ruben.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk