Created on 2008-06-03.00:00:00 last changed 172 months ago
Proposed resolution:
within the synopsis in [atomics.types.integral] edit as follows.
.... typedef struct atomic_bool { .... constexpr
explicitatomic_bool(bool); .... typedef struct atomic_itype { .... constexprexplicitatomic_itype(integral); ....
edit [atomics.types.integral] paragraph 2 as follows.
The atomic integral types shall have standard layout. They shall each have a trivial default constructor, a constexpr
explicitvalue constructor, a deleted copy constructor, a deleted copy assignment operator, and a trivial destructor. They shall each support aggregate initialization syntax.
within the synopsis of [atomics.types.address] edit as follows.
.... typedef struct atomic_address { .... constexpr
explicitatomic_address(void*); ....
edit [atomics.types.address] paragraph 1 as follows.
The type
atomic_address
shall have standard layout. It shall have a trivial default constructor, a constexprexplicitvalue constructor, a deleted copy constructor, a deleted copy assignment operator, and a trivial destructor. It shall support aggregate initialization syntax.
within the synopsis of [atomics.types.generic] edit as follows.
.... template <class T> struct atomic { .... constexpr
explicitatomic(T); .... template <> struct atomic<integral> : atomic_itype { .... constexprexplicitatomic(integral); .... template <> struct atomic<T*> : atomic_address { .... constexprexplicitatomic(T*); ....
edit [atomics.types.generic] paragraph 2 as follows.
Specializations of the
atomic
template shall have a deleted copy constructor, a deleted copy assignment operator, and a constexprexplicitvalue constructor.
[ San Francisco: ]
The preferred approach to resolving this is to remove the explicit specifiers from the atomic integral type constructors.
Lawrence will provide wording.
This issue is addressed in N2783.
[ Jens adds: ]
Note that
atomic_itype a1 = { 5 };would be aggregate-initialization syntax (now coming under the disguise of brace initialization), but would be ill-formed, because the corresponding constructor for atomic_itype is explicit. This works, though:
atomic_itype a2 { 6 };
The atomic classes (and class templates) are required to support aggregate initialization ([atomics.types.integral] p. 2 / [atomics.types.address] p. 1) yet also have user declared constructors, so cannot be aggregates.
This problem might be solved with the introduction of the proposed initialization syntax at Antipolis, but the wording above should be altered. Either strike the sentence as redundant with new syntax, or refer to 'brace initialization'.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg4029 |
2010-10-21 18:28:33 | admin | set | messages: + msg4028 |
2010-10-21 18:28:33 | admin | set | messages: + msg4027 |
2008-06-03 00:00:00 | admin | create |