Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate authored Oct 9, 2024
1 parent bfefda9 commit a7f3be3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/cpp_tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ std::osyncstream(std::cout) << "the answer is " << 42 << '\n';
`std::osyncstream` 可以保证:1. 不会产生数据竞争;2. 不会发生穿插和截断。可以理解为 `std::osyncstream` 在构造时对缓冲区上锁,在析构时解锁。
如果你的标准库支持 C++23,还可以用 `std::println`,这一整个打印操作也是原子的(第三方库如 `fmt::println` 亦可):
如果你的标准库支持 C++23,还可以用 `std::println`,这个函数的输出也是原子的(第三方库如 `fmt::println` 亦可):
```cpp
std::println("the answer is {}", 42);
Expand Down

0 comments on commit a7f3be3

Please sign in to comment.