From a141c401f78467bc15f62882fca5d55a007cacbb Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Mon, 17 Feb 2025 00:21:48 +0100 Subject: Reorganize everything --- asl/io/print.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 asl/io/print.hpp (limited to 'asl/io/print.hpp') diff --git a/asl/io/print.hpp b/asl/io/print.hpp new file mode 100644 index 0000000..a1899a8 --- /dev/null +++ b/asl/io/print.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include "asl/formatting/format.hpp" +#include "asl/io/writer.hpp" + +namespace asl +{ + +namespace print_internals +{ + +// @Todo Make print writers thread safe +Writer* get_stdout_writer(); +Writer* get_stderr_writer(); + +} // namespace print_internals + +template +void print(string_view fmt, const Args&... args) +{ + format(print_internals::get_stdout_writer(), fmt, args...); +} + +template +void eprint(string_view fmt, const Args&... args) +{ + format(print_internals::get_stderr_writer(), fmt, args...); +} + +} // namespace asl -- cgit