Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2023-02-18 13:18:37


Ruben Perez wrote:
> On Sat, 18 Feb 2023, 13:34 Peter Dimov via Boost, <boost_at_[hidden]
> <mailto:boost_at_[hidden]> > wrote:
>
>
> Julien Blanc wrote:
> > Fixing that was easy, but it made me wonder if the current approach
> was a
> > good one. I see no reason for partials to be a
> > json_object: they could be anything that maps a string with another (a
> > map<string,string> being a reasonable choice, but it would make
> sense to also
> > support map<string_view, string_view>).
>
> But they can be. Try it.
>
> int main()
> {
> std::string template_( "{{>part}}" );
> std::map<std::string, std::string> partials{ { "part", "something" } };
>
> boost::mustache::render( template_, std::cout, {}, partials );
> }
>
>
>
> Does this not copy the map into a json object?

It does.


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