summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/io
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-16 21:35:13 +0200
committerGitHub <noreply@github.com>2025-08-16 21:35:13 +0200
commit443588a42fe9cf48b5f63184b94afe483cb0e761 (patch)
treeb65844000839103efb40c635337339dc8f193f89 /dev/lib/io
parent8b7b48fe4acf0482580930eaebaa2f316727f864 (diff)
parent95db0ac7dcb8625c5a1e92408c0c02962b205871 (diff)
Merge pull request #3 from snutech-gh/dev
SOCL – v1.0.4
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