]> git.tdb.fi Git - libs/core.git/blob - source/io/print.h
Add move semantics to Variant
[libs/core.git] / source / io / print.h
1 #ifndef MSP_IO_PRINT_H_
2 #define MSP_IO_PRINT_H_
3
4 #include <msp/strings/format.h>
5 #include "base.h"
6 #include "console.h"
7
8 namespace Msp {
9 namespace IO {
10
11 /**
12 Writes a string to an I/O object.  Same as o.write(f).  Provided for
13 completeness with the other print functions.
14 */
15 inline unsigned print(Base &o, const std::string &f)
16 { return o.write(f); }
17
18 template<typename... Args>
19 inline unsigned print(Base &o, const std::string &f, Args... args)
20 { return print(o, format(f, args...)); }
21
22 /* The following functions print to console */
23
24 inline unsigned print(const std::string &f)
25 { return print(cout, f); }
26
27 template<typename... Args>
28 inline unsigned print(const std::string &f, Args... args)
29 { return print(cout, f, args...); }
30
31 } // namespace IO
32 } // namespace Msp
33
34 #endif