log: use forwarding references for format parameters

This commit is contained in:
Danny Robson 2018-08-01 14:19:44 +10:00
parent 08d8eb942d
commit c7fe53f430

11
log.hpp
View File

@ -82,9 +82,16 @@ namespace util {
template <typename ...Args, size_t N>
void
log (level_t l, const char (&fmt)[N], const Args&...args)
log (level_t l, const char (&fmt)[N], Args &&...args)
{
log (l, to_string (format::printf (fmt) (args...)));
log (
l,
to_string (
format::printf (fmt) (
std::forward<Args> (args)...
)
)
);
}