This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.

3160. atomic_ref() = delete; should be deleted

Section: 32.5.7 [atomics.ref.generic] Status: C++20 Submitter: Tim Song Opened: 2018-10-01 Last modified: 2021-02-25

Priority: 0

View all other issues in [atomics.ref.generic].

View all issues with C++20 status.

Discussion:

atomic_ref has a deleted default constructor, which causes pointless ambiguities in cases like:

void meow(atomic_ref<int>);
void meow(some_default_constructible_struct);

meow({});

It should have no default constructor rather than a deleted one. (Note that it has other user-defined constructors and so cannot be an aggregate under any definition.)

[2018-10-06 Status to Tentatively Ready after seven positive votes on the reflector.]

[2018-11, Adopted in San Diego]

Proposed resolution:

This wording is relative to N4762.