Title
atomic_ref() = delete; should be deleted
Status
c++20
Section
[atomics.ref.generic]
Submitter
Tim Song

Created on 2018-10-01.00:00:00 last changed 38 months ago

Messages

Date: 2018-11-12.04:39:29

Proposed resolution:

This wording is relative to N4762.

  • Edit [atomics.ref.generic], class template atomic_ref synopsis, as indicated:

    […]
    atomic_ref() = delete;
    atomic_ref& operator=(const atomic_ref&) = delete;
    […]
    
  • Edit [atomics.ref.int], class template specialization atomic_ref<integral> synopsis, as indicated:

    […]
    atomic_ref() = delete;
    atomic_ref& operator=(const atomic_ref&) = delete;
    […]
    
  • Edit [atomics.ref.float], class template specialization atomic_ref<floating-point> synopsis, as indicated:

    […]
    atomic_ref() = delete;
    atomic_ref& operator=(const atomic_ref&) = delete;
    […]
    
  • Edit [atomics.ref.pointer], class template specialization atomic_ref<T*> synopsis, as indicated:

    […]
    atomic_ref() = delete;
    atomic_ref& operator=(const atomic_ref&) = delete;
    […]
    
Date: 2018-11-12.04:39:29

[ 2018-11, Adopted in San Diego ]

Date: 2018-10-06.00:00:00

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

Date: 2018-10-01.00:00:00

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.)

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2018-11-12 04:39:29adminsetmessages: + msg10209
2018-11-12 04:39:29adminsetstatus: voting -> wp
2018-10-08 05:13:59adminsetstatus: ready -> voting
2018-10-06 10:57:39adminsetmessages: + msg10158
2018-10-06 10:57:39adminsetstatus: new -> ready
2018-10-01 22:07:31adminsetmessages: + msg10153
2018-10-01 00:00:00admincreate