summaryrefslogtreecommitdiff
path: root/asl/print.hpp
blob: d82d52b5b44002b4cf78fef0bdc82e1466ba7219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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