format: accept forwarding references for printf/python

This commit is contained in:
Danny Robson 2018-08-01 14:20:42 +10:00
parent c7fe53f430
commit 4b69b7515b

View File

@ -203,7 +203,7 @@ namespace util::format {
/// parses a printf format string and binds parameters for rendering.
template <typename ...Args>
auto
printf (util::view<const char*> fmt, const Args &...args)
printf (util::view<const char*> fmt, Args &&...args)
{
return printf (fmt) (args...);
}
@ -212,7 +212,7 @@ namespace util::format {
/// parses a python format string and binds parameters for rendering.
template <typename ...Args>
auto
python (util::view<const char*> fmt, const Args &...args)
python (util::view<const char*> fmt, Args &&...args)
{
return python (fmt) (args...);
}