@@ -11525,17 +11525,17 @@
11525
11525
11526
11526
\begin{itemdescr}
11527
11527
\pnum
11528
- \expects
11529
- The expression \tcode{get_deleter()(get())} is well-formed,
11530
- has well-defined behavior, and does not throw exceptions.
11528
+ \effects
11529
+ Equivalent to:
11530
+ \tcode{if (get()) get_deleter()(get());}
11531
11531
\begin{note}
11532
11532
The use of \tcode{default_delete} requires \tcode{T} to be a complete type.
11533
11533
\end{note}
11534
11534
11535
11535
\pnum
11536
- \effects
11537
- If \tcode{get() == nullptr} there are no effects.
11538
- Otherwise \tcode{get_deleter()(get())}.
11536
+ \remarks
11537
+ The behavior is undefined
11538
+ if the evaluation of \tcode{get_deleter()(get())} throws an exception .
11539
11539
\end{itemdescr}
11540
11540
11541
11541
\rSec4[unique.ptr.single.asgn]{Assignment}
@@ -11728,16 +11728,11 @@
11728
11728
\end{itemdecl}
11729
11729
11730
11730
\begin{itemdescr}
11731
- \pnum
11732
- \expects
11733
- The expression \tcode{get_deleter()(get())} is well-formed,
11734
- has well-defined behavior, and does not throw exceptions.
11735
-
11736
11731
\pnum
11737
11732
\effects
11738
- Assigns \tcode{p} to the stored pointer, and then if and only if the old value of the
11739
- stored pointer, \tcode{old_p}, was not equal to \keyword{nullptr}, calls
11740
- \tcode{get_deleter()(old_p)}.
11733
+ Assigns \tcode{p} to the stored pointer, and then,
11734
+ with the old value of the stored pointer, \tcode{old_p},
11735
+ evaluates \tcode{if (old_p) get_deleter()(old_p);}
11741
11736
\begin{note}
11742
11737
The order of these operations is significant
11743
11738
because the call to \tcode{get_deleter()} might destroy \tcode{*this}.
11750
11745
The postcondition does not hold if the call to \tcode{get_deleter()}
11751
11746
destroys \tcode{*this} since \tcode{this->get()} is no longer a valid expression.
11752
11747
\end{note}
11748
+
11749
+ \pnum
11750
+ \remarks
11751
+ The behavior is undefined
11752
+ if the evaluation of \tcode{get_deleter()(old_p)} throws an exception.
11753
11753
\end{itemdescr}
11754
11754
11755
11755
\indexlibrarymember{swap}{unique_ptr}%
0 commit comments