diff options
Diffstat (limited to 'asl/format.hpp')
-rw-r--r-- | asl/format.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/asl/format.hpp b/asl/format.hpp index 6cffd3a..1b4088e 100644 --- a/asl/format.hpp +++ b/asl/format.hpp @@ -51,7 +51,7 @@ struct type_erased_arg // @Todo Use span
void format(writer*, const char* fmt, const type_erased_arg* args, int64_t arg_count);
-} // internals
+} // namespace internals
class formatter
{
@@ -73,7 +73,7 @@ public: template<typename... Args>
void format(writer* w, const char* fmt, const Args&... args)
{
- auto type_erased_args[] = {
+ format_internals::type_erased_arg type_erased_args[] = {
format_internals::type_erased_arg(args)...
};
@@ -81,4 +81,16 @@ void format(writer* w, const char* fmt, const Args&... args) format_internals::format(w, fmt, type_erased_args, types_count<Args...>);
}
+// @Todo Use string_view
+inline void format(writer* w, const char* fmt)
+{
+ format_internals::format(w, fmt, nullptr, 0);
+}
+
+template<int64_t N>
+void AslFormat(formatter& f, const char (&str)[N])
+{
+ f.write(str, N - 1);
+}
+
} // namespace asl
|