diff --git a/example.cpp b/example.cpp index bd88056..bbdca21 100644 --- a/example.cpp +++ b/example.cpp @@ -72,6 +72,11 @@ signed main() { print(tuple{unordered_map{{3,"three"},{1,"one"}}}); print(unordered_set{3,1,4}); + print_no_space("Case #", 0, ": "); + print_no_space(42); + print_no_space(); + print(); + redirect_input("example.in"); print("reading from example.in:", read_string()); redirect_input("example.in"); diff --git a/include/bits/soi-io.hpp b/include/bits/soi-io.hpp index d66f091..a596e09 100644 --- a/include/bits/soi-io.hpp +++ b/include/bits/soi-io.hpp @@ -97,4 +97,10 @@ void print() { std::cout << '\n'; } +template +void print_no_space(Args&&... args) { + using expander = bool[]; + (void)expander{0, (soi::io::print(std::cout, std::forward(args)), false)...}; +} + #endif // SOI_HEADER_IO