<html><head><meta charset="UTF-8">
<title>Missing Mandates for the standard library</title>
  <style type='text/css'>
  body {font-variant-ligatures: none;}
  p {text-align:justify}
  li {text-align:justify}
  blockquote.note, div.note
  {
          background-color:#E0E0E0;
          padding-left: 15px;
          padding-right: 15px;
          padding-top: 1px;
          padding-bottom: 1px;
  }
  p code {color:navy}
  ins p code {color:#00A000}
  p ins code {color:#00A000}
  p del code {color:#A00000}
  ins {color:#00A000}
  del {color:#A00000}
  table#boilerplate { border:0 }
  table#boilerplate td { padding-left: 2em }
  table.bordered, table.bordered th, table.bordered td {
    border: 1px solid;
    text-align: center;
  }
  ins.block {color:#00A000; text-decoration: none}
  del.block {color:#A00000; text-decoration: none}
  #hidedel:checked ~ * del, #hidedel:checked ~ * del * { display:none; visibility:hidden }
  </style>
</head><body>
<table id="boilerplate">
<tr><td>Document number</td><td>P2045R1</td></tr>
<tr><td>Date</td><td>2020-02-14</td></tr>
<tr><td>Project</td><td>Programming Language C++, Library Working Group</td></tr>
<tr><td>Reply-to</td><td>Marshall Clow &lt;mclow.lists&#x40;gmail.com&gt;</td></tr>
</table><hr>
<h1>Missing Mandates for the standard library</h1>
<ul>
 <li><a href="#Introduction">Introduction</a></li>
 <li><a href="#Wording">Wording</a></li>
</ul>
<a name="Introduction"></a>
<h1>Introduction</h1>

<p>As the "Mandating the standard library" papers have progressed/been applied, a few bits have been missed; mostly because parts of the library have moved.</p>

<p>This paper fixes those bits.</p>

<p>Thanks to Richard Smith for enumerating these parts.</p>

<p>Thanks to Tim Song for his review of R0.</p>

<p>Changes from R0:</p>

<ul>
<li>Removed the changes from [res.on.required]</li>
<li>Fix a mis-edit in [coroutine.handle.observers]</li>
<li>Add edits for [coroutine.handle.resumption]</li>
<li>Add a missing edit for [util.smartptr.atomic.weak]/3</li>
</ul>


<a name="Wording"></a>
<h1>Wording</h1>

<p>These changes are based on <a href="https://wg21.link/N4842">N4842</a>.</p>

<p>In [tab:cpp17.allocator], change the "Requires" to an "Preconditions":</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>(*p).m</code> is well-defined.</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>(*q).m</code> is well-defined.</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>p</code> <ins>is</ins><del>shall be</del> a value returned by an earlier call to <code>allocate</code> that has not been invalidated by an intervening call to <code>deallocate</code>. <code>n</code> <ins>matches</ins><del>shall match</del> the value passed to <code>allocate</code> to obtain this memory.</p>

<p>&nbsp;
&nbsp;</p>

<p>In [coroutine.handle.con]/2, change the "Requires" to an "Preconditions":</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>p</code> is a reference to a promise object of a coroutine.</p>

<p>&nbsp;
&nbsp;</p>

<p>In [coroutine.handle.export.import]/2, change the "Requires" to an "Preconditions":</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>addr</code> was obtained via a prior call to <code>address</code></p>

<p>&nbsp;
&nbsp;</p>

<p>In [coroutine.handle.observers]/2, change the "Requires" to an "Preconditions":</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>*this</code> refers to a suspended coroutine</p>

<p>&nbsp;
&nbsp;</p>

<p>In [coroutine.handle.resumption], edit /2, /3 /4, as follows:</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>*this</code> refers to a suspended coroutine. <ins>The coroutine is not suspended at its final suspend point.</ins></p>

<p><i>Effects: Resumes the execution of the coroutine. <del>If the coroutine was suspended at its final suspend point, behavior is undefined.</del></p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>*this</code> refers to a suspended coroutine</p>

<p>&nbsp;
&nbsp;</p>

<p>In [coroutine.handle.promise]/1, change the "Requires" to an "Preconditions":</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>*this</code> refers to a coroutine.</p>

<p>&nbsp;
&nbsp;</p>

<p>In [util.smartptr.atomic.shared]/3, /6, and /12, change the "Requires" to an "Preconditions":</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del>  <ins><code>order</code> is neither</ins><del> The <code>order</code> argument shall not be</del> <code>memory_order::consume</code>, <code>memory_order::acquire</code>, nor <code>memory_order::acq_rel</code>.</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>order</code> <ins>is neither</ins><del>shall not be</del> <code>memory_order::release</code> nor <code>memory_order::acq_rel</code>.</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> <code>failure</code> <ins>is neither</ins><del>shall not be</del> <code>memory_order::release</code> nor <code>memory_order::acq_rel</code>.</p>

<p>&nbsp;
&nbsp;</p>

<p>In [util.smartptr.atomic.weak]/3, /6 and /12, change the "Requires" to an "Preconditions":</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del>  <ins><code>order</code> is neither</ins><del> The <code>order</code> argument shall not be</del> <code>memory_order::consume</code>, <code>memory_order::acquire</code>, nor <code>memory_order::acq_rel</code>.</p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> order <ins>is neither</ins><del>shall not be</del> <code>memory_order::release</code> nor <code>memory_order::acq_rel</code></p>

<p><ins><i>Preconditions:</i></ins><del><i>Requires:</i></del> failure <ins>is neither</ins><del>shall not be</del> <code>memory_order::release</code> nor <code>memory_order::acq_rel</code></p>
</body></html>
