Skip to content

Commit 1db85e3

Browse files
author
expnkx
committed
transaction
1 parent 6cc849c commit 1db85e3

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include"../../include/fast_io_legacy.h"
2+
3+
int main()
4+
{
5+
print_transaction(fast_io::c_stdout,[](auto& m)
6+
{
7+
print(m,"Hello world\n");
8+
print(m,"Hello world\n");
9+
print(m,"Hello world\n");
10+
print(m,"Hello world\n");
11+
print(m,"Hello world\n");
12+
print(m,"Hello world\n");
13+
print(m,"Hello world\n");
14+
print(m,"Hello world\n");
15+
print(m,"Hello world\n");
16+
print(m,"Hello world\n");
17+
print(m,"Hello world\n");
18+
print(m,"Hello world\n");
19+
print(m,"Hello world\n");
20+
21+
});
22+
}

include/fast_io_core_impl/print_scan.h

+8
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,14 @@ inline constexpr void print_fallback(output &out,Args&& ...args)
309309
}
310310
}
311311

312+
template<output_stream output,typename callback>
313+
inline constexpr void print_transaction(output &out,callback func)
314+
{
315+
internal_temporary_buffer<typename output::char_type> buffer;
316+
func(buffer);
317+
write(out,buffer.beg_ptr,buffer.end_ptr);
318+
}
319+
312320
template<output_stream output,typename ...Args>
313321
inline constexpr void print(output &out,Args&& ...args)
314322
{

0 commit comments

Comments
 (0)