-
Notifications
You must be signed in to change notification settings - Fork 161
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 memory_order syntax #343
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a C++20 feature, but this library is intended to be buildable with C++17 compilers for compatibility with (maybe somewhat dated) user code.
Also, could you please elaborate on why those changes are required in the first place?
This change is required because this code just does not compile.
See libc++ syntax for memory_order: |
I can remove first |
well, it used to compile in CI/CD against a set of compilers... |
cacf434
to
2ac94d0
Compare
Testing the code against clang-10 is a bit weird in 2023 as it is 3.5 years old. |
Backward compatibility matters. |
Forward compatibility matters too. |
cplusplus macro is needed |
@1261385937 What do you mean ? |
Totally agree, and with your help, we now have both! Thanks! |
std::memory_order::memory_order_relaxed
syntax is invalid in-std=c++20
.See:
https://en.cppreference.com/w/cpp/atomic/memory_order
https://github.com/llvm/llvm-project/blob/main/libcxx/include/__atomic/memory_order.h