summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/io
diff options
context:
space:
mode:
Diffstat (limited to 'dev/lib/io')
-rw-r--r--dev/lib/io/print.hpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/dev/lib/io/print.hpp b/dev/lib/io/print.hpp
index e326845..eb425c1 100644
--- a/dev/lib/io/print.hpp
+++ b/dev/lib/io/print.hpp
@@ -8,22 +8,35 @@
#ifndef _SNU_PRINT_HPP
#define _SNU_PRINT_HPP
+#include <initializer_list>
#include <iostream>
+#include <ostream>
namespace snu::io
{
- template <typename... T>
- inline void print(T... fmt)
+ template <typename T, typename... Args>
+ inline void print(T fmt, Args... other) noexcept
{
- std::cout << std::move(fmt...);
+ std::cout << fmt;
+ print(other...);
}
- template <typename... T>
- inline void println(T... fmt)
+ template <typename T>
+ inline void print(T fmt) noexcept
+ {
+ std::cout << fmt;
+ }
+
+ inline void print() noexcept
{
- std::cout << std::move(fmt...);
std::cout << std::endl;
}
+
+ template <typename... T>
+ inline void println(T... fmt) noexcept
+ {
+ print(fmt...);
+ }
} // namespace snu::io
-#endif // ifndef _SNU_PRINT_HPP \ No newline at end of file
+#endif // ifndef _SNU_PRINT_HPP