Fix log with no arguments
This commit is contained in:
@ -67,10 +67,17 @@ void log_inner(level l, string_view fmt, span<const format_internals::type_erase
|
|||||||
template<formattable... Args>
|
template<formattable... Args>
|
||||||
void log(level l, const source_location& sl, string_view fmt, const Args&... args)
|
void log(level l, const source_location& sl, string_view fmt, const Args&... args)
|
||||||
{
|
{
|
||||||
format_internals::type_erased_arg type_erased_args[] = {
|
if constexpr (sizeof...(Args) == 0)
|
||||||
format_internals::type_erased_arg(args)...
|
{
|
||||||
};
|
log_inner(l, fmt, {}, sl);
|
||||||
log_inner(l, fmt, type_erased_args, sl);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
format_internals::type_erased_arg type_erased_args[] = {
|
||||||
|
format_internals::type_erased_arg(args)...
|
||||||
|
};
|
||||||
|
log_inner(l, fmt, type_erased_args, sl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace asl::log
|
} // namespace asl::log
|
||||||
|
Reference in New Issue
Block a user