From 3dc9bc3a6cefa30c553c6ec21b1545db98e26b6d Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sat, 23 Nov 2024 23:48:24 +0100 Subject: Add float formatting --- asl/format.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'asl/format.hpp') diff --git a/asl/format.hpp b/asl/format.hpp index 7cf3917..9504701 100644 --- a/asl/format.hpp +++ b/asl/format.hpp @@ -77,11 +77,16 @@ void format(Writer* w, string_view fmt, const Args&... args) template void AslFormat(Formatter& f, const char (&str)[N]) { - f.write(str, N - 1); + f.write(string_view(str, N - 1)); } void AslFormat(Formatter& f, const char* str); +inline void AslFormat(Formatter& f, string_view sv) +{ + f.write(sv); +} + void AslFormat(Formatter& f, float); void AslFormat(Formatter& f, double); -- cgit