Skip to content

[atomics.types.operations] note typo #4000

Closed
@Dani-Hub

Description

@Dani-Hub

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions