Title
What is 'aggregate initialization syntax'?
Status
resolved
Section
[atomics.types.generic]
Submitter
S. B. Tam

Created on 2016-05-24.00:00:00 last changed 86 months ago

Messages

Date: 2017-03-14.03:25:42

Proposed resolution:

This wording is relative to N4606.

  1. 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. They shall each support aggregate initialization syntax.

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

Date: 2017-03-15.00:00:00

[ 2017-03-04, Kona ]

This is resolved by P0558.

Date: 2016-11-15.00:00:00

[ 2016-11-12, Issaquah ]

Sat PM: The key here is that we need to support = { ... }

JW to provide wording

Date: 2016-11-15.00:00:00

[ 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]

Date: 2016-05-24.00:00:00

[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:42adminsetmessages: + msg9123
2017-03-14 03:25:42adminsetstatus: new -> resolved
2016-11-21 05:09:01adminsetmessages: + msg8661
2016-11-13 12:39:35adminsetmessages: + msg8627
2016-11-13 12:39:35adminsetmessages: + msg8626
2016-05-24 00:00:00admincreate