Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Nov 12, 2025

Fixes #5838.

Notes:

  • constexpr is intentionally not added because it should belong to P3309R3 "constexpr atomic And atomic_ref". The new constructor should be marked _CONSTEXPR26 in a future PR.
  • This PR also adds an explicit atomic_ref(_Ty&&) = delete; overload to disallow bogus explicit construction of atomic_ref<const T> from atomic_ref<volatile T> or atomic_ref<const volatile T>. Such construction is currently unfortunately well-formed because of the operator T conversion function. I've mailed LWG Chair to file an LWG issue for this. Edit: The issue is now LWG-4472.
  • Convertibility detection in the new constraints is implemented with is_convertible_v<_Uty (*)[], _Ty (*)[]>, which is consistent with pre-existing detections in unique_ptr, shared_ptr, span, mdspan, and ranges::subrange. Conversions related to array of unknown bound types are not yet tested because MSVC and EDG (and even GCC) seem to be buggy for the the changes in WG21-P0388R4.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner November 12, 2025 01:27
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Nov 12, 2025
@StephanTLavavej StephanTLavavej added cxx20 C++20 feature defect report Applied retroactively labels Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx20 C++20 feature defect report Applied retroactively

Projects

Status: Initial Review

Development

Successfully merging this pull request may close these issues.

P3860R1 Make atomic_ref<T> Convertible To atomic_ref<const T>

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.