diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-30 23:16:49 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-30 23:16:49 +0100 |
commit | f882f51c0500f9a31c5e77b252fee63ab3726f7e (patch) | |
tree | a6454c936989790c9e2a087e109452238a59c862 /asl | |
parent | b3f2336e1b8f4410515344feb73d992d854c8282 (diff) |
Fix log with no arguments
Diffstat (limited to 'asl')
-rw-r--r-- | asl/log/log.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/asl/log/log.hpp b/asl/log/log.hpp index a6b8f03..f2e3a47 100644 --- a/asl/log/log.hpp +++ b/asl/log/log.hpp @@ -67,10 +67,17 @@ void log_inner(level l, string_view fmt, span<const format_internals::type_erase template<formattable... Args> void log(level l, const source_location& sl, string_view fmt, const Args&... args) { - format_internals::type_erased_arg type_erased_args[] = { - format_internals::type_erased_arg(args)... - }; - log_inner(l, fmt, type_erased_args, sl); + if constexpr (sizeof...(Args) == 0) + { + log_inner(l, fmt, {}, 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 |