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
I support the idea of getting rid of json::value for partials and get something more constrained. Regards, Ruben.