diff options
| author | Amlal <amlal@nekernel.org> | 2025-08-12 11:53:13 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-08-12 11:53:24 +0200 |
| commit | 54e32a8a3535d99d104775687af0731b0be3b129 (patch) | |
| tree | b43e378237a724699b785ae21ca63374c510564c /dev/lib/io | |
| parent | 2450c6579543ae94b3dcb2af4893cfc6ecd0fcef (diff) | |
wip: work in progress network tests using GTest. Reworked print module too.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/io')
| -rw-r--r-- | dev/lib/io/print.hpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/dev/lib/io/print.hpp b/dev/lib/io/print.hpp index e326845..36192c4 100644 --- a/dev/lib/io/print.hpp +++ b/dev/lib/io/print.hpp @@ -8,20 +8,34 @@ #ifndef _SNU_PRINT_HPP #define _SNU_PRINT_HPP +#include <initializer_list> #include <iostream> +#include <ostream> namespace snu::io -{ +{ + template <typename T> + inline void printv(T fmt) noexcept + { + std::cout << fmt; + } + + template <typename T> + inline void printv(std::initializer_list<T> fmt) noexcept + { + std::cout << fmt; + } + template <typename... T> - inline void print(T... fmt) + inline void print(T... fmt) noexcept { - std::cout << std::move(fmt...); + (printv(fmt), ...); } template <typename... T> - inline void println(T... fmt) + inline void println(T... fmt) noexcept { - std::cout << std::move(fmt...); + print(static_cast<T>(fmt)...); std::cout << std::endl; } } // namespace snu::io |
