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

Created on 2018-10-01.00:00:00, last changed 2018-10-01.22:07:31.

Messages

Date: 2018-10-01.22:07:31

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-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
2018-10-01 22:07:31adminsetmessages: + msg10116
2018-10-01 00:00:00admincreate