Created on 2016-05-24.00:00:00 last changed 94 months ago
Proposed resolution:
This wording is relative to N4606.
Edit [atomics.types.generic] as indicated:
-5- The atomic integral specializations and the specialization atomic<bool> shall have standard layout. They shall each have a trivial default constructor and a trivial destructor.
-6- There shall be pointer partial specializations of the atomic class template. These specializations shall have standard layout, trivial default constructors, and trivial destructors.They shall each support aggregate initialization syntax.They shall each support aggregate initialization syntax.
[ 2017-03-04, Kona ]
This is resolved by P0558.
[ 2016-11-12, Issaquah ]
Sat PM: The key here is that we need to support = { ... }
JW to provide wording
[ 2016-11-13, Jonathan comments and provides wording ]
LWG agreed to simply strike those sentences. We believe their purpose is to require that the same syntax as C programs use is valid, e.g.
atomic_int i = { 1 };
But such syntax is already required to work by the constructor definitions, so there is no need to require it again here with redundant wording. It's unnecessary to require that syntax for the atomic<T*> specializations because they have no equivalent in C anyway (unlike the named atomic types for integers, there are no typedefs for atomic<T*>).
If wanted, we could add an example demonstrating the syntax that works for both C and C++ but the preference was to not do so: [Example: For compatibility with the related types in the C library the following syntax can be used:atomic_int i = { 1 };
— end example]
[atomics.types.generic] mentions 'aggregate initialization syntax'. It's unclear what it stands for, especially since atomic types are actually not aggregate types (they have user-provided constructors).
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-03-14 03:25:42 | admin | set | messages: + msg9123 |
2017-03-14 03:25:42 | admin | set | status: new -> resolved |
2016-11-21 05:09:01 | admin | set | messages: + msg8661 |
2016-11-13 12:39:35 | admin | set | messages: + msg8627 |
2016-11-13 12:39:35 | admin | set | messages: + msg8626 |
2016-05-24 00:00:00 | admin | create |