Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: thread_count failed to construct before g++11 #199

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

Mintpasokon
Copy link
Contributor

@Mintpasokon Mintpasokon commented Apr 3, 2023

PR 198 fails to build with g++ 9 since
std::atomic<unsigned int> thread_count = 0;
would call deleted copy constructor
atomic& operator=(const atomic&) = delete;
instead of constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { } before g++ 11 and clang 16.
This new construction method is to use std::atomic<unsigned int> thread_count(0u);, which will successfully compile in my tests with g++ 4.8.5, 9, 10, 11, and 12.

@jlblancoc jlblancoc merged commit 42e75db into jlblancoc:master Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants