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

[atomics.types.operations] note typo #4000

Closed
Dani-Hub opened this issue May 17, 2020 · 0 comments · Fixed by #4001
Closed

[atomics.types.operations] note typo #4000

Dani-Hub opened this issue May 17, 2020 · 0 comments · Fixed by #4001

Comments

@Dani-Hub
Copy link
Member

The note in [atomics.types.operations] p25 (N4861) contains the following code example of the effects of the compare_exchange_strong operation:

if (memcmp(this, &expected, sizeof(*this)) == 0)
  memcpy(this, &desired, sizeof(*this));
else
  memcpy(expected, this, sizeof(*this));

This code is ill-formed, because expected in the else-branch is missing a leading & operator.

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.

1 participant