Skip to content

Commit a7f3be3

Browse files
authored
Apply suggestions from code review
1 parent bfefda9 commit a7f3be3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/cpp_tricks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ std::osyncstream(std::cout) << "the answer is " << 42 << '\n';
10591059
10601060
`std::osyncstream` 可以保证:1. 不会产生数据竞争;2. 不会发生穿插和截断。可以理解为 `std::osyncstream` 在构造时对缓冲区上锁,在析构时解锁。
10611061
1062-
如果你的标准库支持 C++23,还可以用 `std::println`,这一整个打印操作也是原子的(第三方库如 `fmt::println` 亦可):
1062+
如果你的标准库支持 C++23,还可以用 `std::println`,这个函数的输出也是原子的(第三方库如 `fmt::println` 亦可):
10631063
10641064
```cpp
10651065
std::println("the answer is {}", 42);

0 commit comments

Comments
 (0)