diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-16 21:35:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-16 21:35:13 +0200 |
| commit | 443588a42fe9cf48b5f63184b94afe483cb0e761 (patch) | |
| tree | b65844000839103efb40c635337339dc8f193f89 /dev/lib/io | |
| parent | 8b7b48fe4acf0482580930eaebaa2f316727f864 (diff) | |
| parent | 95db0ac7dcb8625c5a1e92408c0c02962b205871 (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.hpp | 27 |
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 |
