We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed9392e commit b80e679Copy full SHA for b80e679
docs/cpp_tricks.md
@@ -725,7 +725,7 @@ int main() {
725
如果喜欢老式的函数调用风格接口,可以封装一个新的 C++ 重置版安全 `rand`:
726
727
```cpp
728
-thread_local std::mt19937 gen(std::random_device()()); // 每线程一个,互不冲突
+thread_local std::mt19937 gen(std::random_device{}()); // 每线程一个,互不冲突
729
730
int randint(int min, int max) {
731
return std::uniform_int_distribution<int>(min, max)(gen);
0 commit comments