Skip to content

Update cpp_tricks.md: gen(std::random_device()()); 会被当成函数,无法编译 #46

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

CrossroadW
Copy link
Contributor

Suggestion

thread_local std::mt19937 gen(std::random_device()());
会被当成函数,无法编译
Copy link
Contributor

@archibate archibate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gen{random_device()()}也可以

@archibate archibate merged commit 89e6408 into parallel101:main Sep 22, 2024
@CrossroadW
Copy link
Contributor Author

学到了

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants