summaryrefslogtreecommitdiff
path: root/asl/io/print.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'asl/io/print.hpp')
-rw-r--r--asl/io/print.hpp30
1 files changed, 30 insertions, 0 deletions
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<formattable... Args>
+void print(string_view fmt, const Args&... args)
+{
+ format(print_internals::get_stdout_writer(), fmt, args...);
+}
+
+template<formattable... Args>
+void eprint(string_view fmt, const Args&... args)
+{
+ format(print_internals::get_stderr_writer(), fmt, args...);
+}
+
+} // namespace asl