diff options
Diffstat (limited to 'asl/print.hpp')
-rw-r--r-- | asl/print.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/asl/print.hpp b/asl/print.hpp new file mode 100644 index 0000000..d82d52b --- /dev/null +++ b/asl/print.hpp @@ -0,0 +1,31 @@ +#pragma once
+
+#include "asl/format.hpp"
+
+namespace asl
+{
+
+namespace print_internals
+{
+
+// @Todo Make print writers thread safe
+writer* get_stdout_writer();
+writer* get_stderr_writer();
+
+} // namespace print_internals
+
+// @Todo Use string_view
+template<formattable... Args>
+void print(const char* fmt, const Args&... args)
+{
+ format(print_internals::get_stdout_writer(), fmt, args...);
+}
+
+// @Todo Use string_view
+template<formattable... Args>
+void eprint(const char* fmt, const Args&... args)
+{
+ format(print_internals::get_stderr_writer(), fmt, args...);
+}
+
+} // namespace asl
|