Skip to content

[atomics.types.operations]p20's note makes incorrect assumptions about atomic representation #2104

Open
@zygoloid

Description

@zygoloid

[ Note: For example, the effect of compare_exchange_strong is

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

end note ]

This is wrong in a multitude of ways... not least of which is that that's not even atomic. But also this assumes that sizeof(atomic<T>) == sizeof(T), that the layout of an atomic directly contains a T, and so on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    sg1Issue must be reviewed by SG1.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions