<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2715: What is 'aggregate initialization syntax'?</title>
<meta property="og:title" content="Issue 2715: What is 'aggregate initialization syntax'?">
<meta property="og:description" content="C++ library issue. Status: Resolved">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2715.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#Resolved">Resolved</a> status.</em></p>
<h3 id="2715"><a href="lwg-defects.html#2715">2715</a>. What is 'aggregate initialization syntax'?</h3>
<p><b>Section:</b> 32.5.8 <a href="https://wg21.link/atomics.types.generic">[atomics.types.generic]</a> <b>Status:</b> <a href="lwg-active.html#Resolved">Resolved</a>
 <b>Submitter:</b> S. B. Tam <b>Opened:</b> 2016-05-24 <b>Last modified:</b> 2017-03-20</p>
<p><b>Priority: </b>3
</p>
<p><b>View all other</b> <a href="lwg-index.html#atomics.types.generic">issues</a> in [atomics.types.generic].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Resolved">Resolved</a> status.</p>
<p><b>Discussion:</b></p>
<p>
32.5.8 <a href="https://wg21.link/atomics.types.generic">[atomics.types.generic]</a> 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).
</p>

<p><i>[2016-11-13, Jonathan comments and provides wording]</i></p>

<p>
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.
</p>
<pre>
<code>atomic_int i = { 1 };</code>
</pre>
<p>
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 <code>atomic&lt;T*&gt;</code>
specializations because they have no equivalent in C anyway (unlike
the named atomic types for integers, there are no typedefs for
<code>atomic&lt;T*&gt;</code>).
<p/>
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:
<p/>
[<i>Example:</i> For compatibility with the related types in the C library
the following syntax can be used:
</p>
<blockquote><pre>
 atomic_int i = { 1 };
</pre></blockquote>
<p>
&mdash; <i>end example</i>]
</p>
<p><i>[2016-11-12, Issaquah]</i></p>

<p>Sat PM: The key here is that we need to support <code>= { ... }</code></p>
<p>JW to provide wording</p>

<p><i>[2017-03-04, Kona]</i></p>

<p>This is resolved by P0558.</p>


<p id="res-2715"><b>Proposed resolution:</b></p>
<p>This wording is relative to N4606.</p>

<ol>
<li>
<p>Edit 32.5.8 <a href="https://wg21.link/atomics.types.generic">[atomics.types.generic]</a> as indicated:</p>

<blockquote>
<p>
-5- The atomic integral specializations and the specialization <code>atomic&lt;bool&gt;</code> shall have standard layout. They
shall each have a trivial default constructor and a trivial destructor. <del>They shall each support aggregate
initialization syntax.</del>
<p/>
-6- There shall be pointer partial specializations of the <code>atomic</code> class template. These specializations shall have
standard layout, trivial default constructors, and trivial destructors. <del>They shall each support aggregate
initialization syntax.</del>
</p>
</blockquote>
</li>
</ol>





</body>
</html>
