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

[2024-03 LWG Motion 9] Atomic minimum/maximum #6880

Closed
jensmaurer opened this issue Mar 23, 2024 · 7 comments · Fixed by #6918
Closed

[2024-03 LWG Motion 9] Atomic minimum/maximum #6880

jensmaurer opened this issue Mar 23, 2024 · 7 comments · Fixed by #6918
Assignees
Milestone

Comments

@jensmaurer
Copy link
Member

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf

@jensmaurer jensmaurer added this to the post-2024-03 milestone Mar 23, 2024
@AlisdairM
Copy link
Contributor

Requesting this be assigned to me

@AlisdairM
Copy link
Contributor

Note 1 leaves me more confused than educated --- it is very easy to read that there are no pointers that have a weak ordering.

Suggest instead: Note 1: The < operator does not establish a strict weak ordering ([tab:cpp17.lessthancomparable][expr.rel]) unless comparing subobjects of the same complete object, where array elements are subobjects of their array.

@AlisdairM
Copy link
Contributor

The feature macro __cpp_lib_atomic_min_max is requesting support in freestanding, is that correct or an oversight?

@frederick-vs-ja
Copy link
Contributor

Suggest instead: Note 1: The < operator does not establish a strict weak ordering ([tab:cpp17.lessthancomparable][expr.rel]) unless comparing subobjects of the same complete object, where array elements are subobjects of their array.

This is still possibly misleading in the case where both complete objects are nested within the same byte array. But the core wording seems a bit unclear on the address of an object whose storage is provided-for...

@jwakely
Copy link
Member

jwakely commented Mar 25, 2024

The feature macro __cpp_lib_atomic_min_max is requesting support in freestanding, is that correct or an oversight?

Everything else in <atomic> is freestanding, except for the atomic_signed_lock_free and atomic_unsigned_lock_free aliases.

The new non-member functions like atomic_fetch_max are marked freestanding. The members fetch_max and fetch_min are part of a fully freestanding class template (e.g. not marked partially freestanding).

So the feature test macro should match, and also be defined for freestanding.

@jensmaurer jensmaurer changed the title [2024-03 LWG Motion 9] Atomic minimum/maximu [2024-03 LWG Motion 9] Atomic minimum/maximum Mar 28, 2024
@AlisdairM
Copy link
Contributor

Sorry, should have pushed the PR before the weekend.

@AlisdairM
Copy link
Contributor

Note that the initial pull request #6918 does not revise the comment from the paper. If there is consensus on a clearer wording, let me know and I can apply it. Alternatively, we can defer clarifying the comment to a separate editorial PR after all the Tokyo papers have landed.

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 a pull request may close this issue.

4 participants