Boost logo

Boost :

From: Ruben Perez (rubenperez038_at_[hidden])
Date: 2023-02-18 13:10:15


On Sat, 18 Feb 2023, 13:34 Peter Dimov via Boost, <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?

Thanks,
Ruben.

>


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