P3309R3 `constexpr` `atomic` And `atomic_ref`
WG21-P3309R3 constexpr atomic And atomic_ref
Feature-test macro (expected):
#define __cpp_lib_constexpr_atomic 202411L
Note: We're focused on implementing the remaining library-only features in C++23. Until that's done, we will NOT be accepting PRs for C++26 features.
It seems that compiler support is required to bypass non-trivial copy/move function templates that hijacks normal copy/move functions...
Can you explain a scenario where that's implied by the Standardese? My cat-sized brain isn't following.
Can you explain a scenario where that's implied by the Standardese? My cat-sized brain isn't following.
#include <atomic>
struct S {
S() = default;
S(S&&) = default;
S& operator=(const S&) = default;
S& operator=(S&&) = default;
S(const volatile S&) = delete;
template<class = void>
S(const S&) {}
};
int main() {
std::atomic<S> a [[maybe_unused]] = S{};
}
Hmm, it seems to me that the constructor template in this example should be ignored (but libstdc++ and MSVC STL use it; Godbolt link).
For store etc., an assignment operator template might matter.