Skip to content

Commit f440634

Browse files
committed
Restore lost exception safety function attributes.
Fixes cplusplus#11.
1 parent 4f6d59e commit f440634

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

elements/function.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<pre><code><content select="cxx-signature"/></code></pre>
1010

1111
<dl>
12-
<content select="cxx-requires,cxx-effects,cxx-synchronization,cxx-postconditions,cxx-returns,cxx-throws,cxx-remarks,cxx-error-conditions,cxx-notes"/>
12+
<content select="cxx-requires,cxx-effects,cxx-synchronization,cxx-postconditions,cxx-returns,cxx-throws,cxx-exception-safety,cxx-remarks,cxx-error-conditions,cxx-notes"/>
1313
</dl>
1414
</template>
1515
<script>

fundamentals-ts.html

+32-8
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,10 @@ <h1>Contents</h1>
12611261
</cxx-returns><cxx-postconditions para_num="9" id="optional.object.assign.9">
12621262

12631263
<dt>Postconditions:</dt><dd><code>bool(<var>rhs</var>) == bool(*this)</code>.</dd>
1264-
</cxx-postconditions></dl>
1264+
</cxx-postconditions><cxx-exception-safety para_num="10" id="optional.object.assign.10">
1265+
1266+
<dt>Exception safety:</dt><dd>If any exception is thrown, values of <code><var>init</var></code> and <code><var>rhs.init</var></code> remain unchanged. If an exception is thrown during the call to <code>T</code>'s copy constructor, no effect. If an exception is thrown during the call to <code>T</code>'s copy assignment, the state of its contained value is as defined by the exception safety guarantee of <code>T</code>'s copy constructor.</dd>
1267+
</cxx-exception-safety></dl>
12651268
</cxx-function>
12661269

12671270
<cxx-function para_num="11" id="optional.object.assign.11">
@@ -1291,7 +1294,10 @@ <h1>Contents</h1>
12911294
</cxx-postconditions><cxx-remarks para_num="16" id="optional.object.assign.16">
12921295

12931296
<dt>Remarks:</dt><dd>The expression inside <code>noexcept</code> is equivalent to: <pre>is_nothrow_move_assignable&lt;T&gt;::value &amp;&amp; is_nothrow_move_constructible&lt;T&gt;::value</pre></dd>
1294-
</cxx-remarks></dl>
1297+
</cxx-remarks><cxx-exception-safety para_num="17" id="optional.object.assign.17">
1298+
1299+
<dt>Exception safety:</dt><dd>If any exception is thrown, values of <code><var>init</var></code> and <code><var>rhs.init</var></code> remain unchanged. If an exception is thrown during the call to <code>T</code>'s move constructor, the state of <code>*rhs.val</code> is determined by the exception safety guarantee of <code>T</code>'s move constructor. If an exception is thrown during the call to <code>T</code>'s move assignment, the state of <code><var>*val</var></code> and <code>*rhs.val</code> is determined by the exception safety guarantee of <code>T</code>'s move assignment.</dd>
1300+
</cxx-exception-safety></dl>
12951301
</cxx-function>
12961302

12971303
<cxx-function para_num="18" id="optional.object.assign.18">
@@ -1311,7 +1317,10 @@ <h1>Contents</h1>
13111317
</cxx-returns><cxx-postconditions para_num="22" id="optional.object.assign.22">
13121318

13131319
<dt>Postconditions:</dt><dd><code>*this</code> is engaged.</dd>
1314-
</cxx-postconditions><cxx-remarks para_num="24" id="optional.object.assign.24">
1320+
</cxx-postconditions><cxx-exception-safety para_num="23" id="optional.object.assign.23">
1321+
1322+
<dt>Exception safety:</dt><dd>If any exception is thrown, the value of <code><var>init</var></code> remains unchanged. If an exception is thrown during the call to <code>T</code>'s constructor, the state of <code><var>v</var></code> is determined by the exception safety guarantee of <code>T</code>'s constructor. If an exception is thrown during the call to <code>T</code>'s assignment, the state of <code><var>*val</var></code> and <code><var>v</var></code> is determined by the exception safety guarantee of <code>T</code>'s assignment.</dd>
1323+
</cxx-exception-safety><cxx-remarks para_num="24" id="optional.object.assign.24">
13151324

13161325
<dt>Remarks:</dt><dd>The function shall not participate in overload resolution unless <code>is_same&lt;typename remove_reference&lt;U&gt;::type, T&gt;::value</code> is <code>true</code>.</dd>
13171326
</cxx-remarks><cxx-notes para_num="25" id="optional.object.assign.25">
@@ -1337,7 +1346,10 @@ <h1>Contents</h1>
13371346
</cxx-postconditions><cxx-throws para_num="30" id="optional.object.assign.30">
13381347

13391348
<dt>Throws:</dt><dd>Any exception thrown by the selected constructor of <code>T</code>.</dd>
1340-
</cxx-throws></dl>
1349+
</cxx-throws><cxx-exception-safety para_num="31" id="optional.object.assign.31">
1350+
1351+
<dt>Exception safety:</dt><dd>If an exception is thrown during the call to <code>T</code>'s constructor, <code>*this</code> is disengaged, and the previous <code><var>*val</var></code> (if any) has been destroyed.</dd>
1352+
</cxx-exception-safety></dl>
13411353
</cxx-function>
13421354

13431355
<cxx-function para_num="32" id="optional.object.assign.32">
@@ -1357,7 +1369,10 @@ <h1>Contents</h1>
13571369
</cxx-postconditions><cxx-throws para_num="36" id="optional.object.assign.36">
13581370

13591371
<dt>Throws:</dt><dd>Any exception thrown by the selected constructor of <code>T</code>.</dd>
1360-
</cxx-throws><cxx-remarks para_num="38" id="optional.object.assign.38">
1372+
</cxx-throws><cxx-exception-safety para_num="37" id="optional.object.assign.37">
1373+
1374+
<dt>Exception safety:</dt><dd>If an exception is thrown during the call to <code>T</code>'s constructor, <code>*this</code> is disengaged, and the previous <code><var>*val</var></code> (if any) has been destroyed.</dd>
1375+
</cxx-exception-safety><cxx-remarks para_num="38" id="optional.object.assign.38">
13611376

13621377
<dt>Remarks:</dt><dd>The function shall not participate in overload resolution unless <code>is_constructible&lt;T, initializer_list&lt;U&gt;&amp;, Args&amp;&amp;...&gt;::value</code> is <code>true</code>.</dd>
13631378
</cxx-remarks></dl>
@@ -1398,7 +1413,10 @@ <h1>Contents</h1>
13981413
</cxx-throws><cxx-remarks para_num="5" id="optional.object.swap.5">
13991414

14001415
<dt>Remarks:</dt><dd>The expression inside <code>noexcept</code> is equivalent to: <pre>is_nothrow_move_constructible&lt;T&gt;::value &amp;&amp; <wbr>noexcept(swap(declval&lt;T&amp;&gt;(), declval&lt;T&amp;&gt;()))</pre></dd>
1401-
</cxx-remarks></dl>
1416+
</cxx-remarks><cxx-exception-safety para_num="6" id="optional.object.swap.6">
1417+
1418+
<dt>Exception safety:</dt><dd>If any exception is thrown, values of <code><var>init</var></code> and <code><var>rhs.init</var></code> remain unchanged. If an exception is thrown during the call to function <code>swap</code> the state of <code><var>*val</var></code> and <code>*rhs.val</code> is determined by the exception safety guarantee of <code>swap</code> for lvalues of <code>T</code>. If an exception is thrown during the call to <code>T</code>'s move constructor, the state of <code><var>*val</var></code> and <code>*rhs.val</code> is determined by the exception safety guarantee of <code>T</code>'s move constructor.</dd>
1419+
</cxx-exception-safety></dl>
14021420
</cxx-function>
14031421

14041422
</section>
@@ -1497,7 +1515,10 @@ <h1>Contents</h1>
14971515
</cxx-returns><cxx-throws para_num="21" id="optional.object.observe.21">
14981516

14991517
<dt>Throws:</dt><dd>Any exception thrown by the selected constructor of <code>T</code>.</dd>
1500-
</cxx-throws><cxx-remarks para_num="23" id="optional.object.observe.23">
1518+
</cxx-throws><cxx-exception-safety para_num="22" id="optional.object.observe.22">
1519+
1520+
<dt>Exception safety:</dt><dd>If <code><var>init</var> == true</code> and exception is thrown during the call to <code>T</code>'s constructor, the value of <code><var>init</var></code> and <code><var>v</var></code> remains unchanged and the state of <code><var>*val</var></code> is determined by the exception safety guarantee of the selected constructor of <code>T</code>. Otherwise, when exception is thrown during the call to <code>T</code>'s constructor, the value of <code><var>*this</var></code> remains unchanged and the state of <code><var>v</var></code> is determined by the exception safety guarantee of the selected constructor of <code>T</code>.</dd>
1521+
</cxx-exception-safety><cxx-remarks para_num="23" id="optional.object.observe.23">
15011522

15021523
<dt>Remarks:</dt><dd>If the selected constructor of <code>T</code> is a <code>constexpr</code> constructor, this function shall be a <code>constexpr</code> function.</dd>
15031524
</cxx-remarks></dl>
@@ -1517,7 +1538,10 @@ <h1>Contents</h1>
15171538
</cxx-returns><cxx-throws para_num="27" id="optional.object.observe.27">
15181539

15191540
<dt>Throws:</dt><dd>Any exception thrown by the selected constructor of <code>T</code>.</dd>
1520-
</cxx-throws></dl>
1541+
</cxx-throws><cxx-exception-safety para_num="28" id="optional.object.observe.28">
1542+
1543+
<dt>Exception safety:</dt><dd>If <code><var>init</var> == true</code> and exception is thrown during the call to <code>T</code>'s constructor, the value of <code><var>init</var></code> and <code><var>v</var></code> remains unchanged and the state of <code><var>*val</var></code> is determined by the exception safety guarantee of the <code>T</code>'s constructor. Otherwise, when exception is thrown during the call to <code>T</code>'s constructor, the value of <code><var>*this</var></code> remains unchanged and the state of <code><var>v</var></code> is determined by the exception safety guarantee of the selected constructor of <code>T</code>.</dd>
1544+
</cxx-exception-safety></dl>
15211545
</cxx-function>
15221546

15231547
</section>

0 commit comments

Comments
 (0)