Skip to content

Commit 4b5d9ad

Browse files
jensmaurerzygoloid
authored andcommitted
[unique.ptr] Remove definition of 'transfers ownership'.
It is mostly subsumed by the detailed descriptions of the move constructors and assignment operators.
1 parent a257a07 commit 4b5d9ad

File tree

1 file changed

+18
-31
lines changed

1 file changed

+18
-31
lines changed

source/utilities.tex

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7941,23 +7941,6 @@
79417941
deleter, but properly disposes of its owned object via the associated
79427942
deleter before such replacement is considered completed.
79437943

7944-
\pnum
7945-
Additionally, \textit{u} can, upon request, \defn{transfer ownership} to another
7946-
unique pointer \textit{u2}. Upon completion of such a transfer, the following
7947-
postconditions hold:
7948-
7949-
\begin{itemize}
7950-
\item \textit{u2.p} is equal to the pre-transfer \textit{u.p},
7951-
\item \textit{u.p} is equal to \tcode{nullptr}, and
7952-
\item if the pre-transfer \textit{u.d} maintained state, such state has been
7953-
transferred to \textit{u2.d}.
7954-
\end{itemize}
7955-
7956-
As in the case of a reset, \textit{u2} properly disposes of its pre-transfer
7957-
owned object via the pre-transfer associated deleter before the ownership
7958-
transfer is considered complete. \begin{note} A deleter's state need never be
7959-
copied, only moved or swapped as ownership is transferred. \end{note}
7960-
79617944
\pnum
79627945
Each object of a type \tcode{U} instantiated from the \tcode{unique_ptr} template
79637946
specified in this subclause has the strict ownership semantics, specified above,
@@ -8297,15 +8280,16 @@
82978280
throw an exception.
82988281

82998282
\pnum
8300-
\effects Constructs a \tcode{unique_ptr} by transferring ownership from
8301-
\tcode{u} to \tcode{*this}. If \tcode{D} is a reference type, this
8283+
\effects Constructs a \tcode{unique_ptr} from
8284+
\tcode{u}. If \tcode{D} is a reference type, this
83028285
deleter is copy constructed from \tcode{u}'s deleter; otherwise, this
83038286
deleter is move constructed from \tcode{u}'s deleter. \begin{note} The
8304-
deleter constructor can be implemented with \tcode{std::forward<D>}. \end{note}
8287+
construction of the deleter can be implemented with \tcode{std::forward<D>}. \end{note}
83058288

83068289
\pnum
83078290
\postconditions \tcode{get()} yields the value \tcode{u.get()}
8308-
yielded before the construction. \tcode{get_deleter()} returns a reference
8291+
yielded before the construction. \tcode{u.get() == nullptr}.
8292+
\tcode{get_deleter()} returns a reference
83098293
to the stored deleter that was constructed from
83108294
\tcode{u.get_deleter()}. If \tcode{D} is a reference type then
83118295
\tcode{get_deleter()} and \tcode{u.get_deleter()} both reference
@@ -8336,15 +8320,15 @@
83368320
\end{itemize}
83378321

83388322
\pnum
8339-
\effects Constructs a \tcode{unique_ptr} by transferring ownership from \tcode{u}
8340-
to \tcode{*this}. If \tcode{E} is a reference type, this deleter is copy constructed from
8323+
\effects Constructs a \tcode{unique_ptr} from \tcode{u}.
8324+
If \tcode{E} is a reference type, this deleter is copy constructed from
83418325
\tcode{u}'s deleter; otherwise, this deleter is move constructed from \tcode{u}'s
83428326
deleter. \begin{note} The deleter constructor can be implemented with
83438327
\tcode{std::forward<E>}. \end{note}
83448328

83458329
\pnum
83468330
\postconditions \tcode{get()} yields the value \tcode{u.get()}
8347-
yielded before the construction.
8331+
yielded before the construction. \tcode{u.get() == nullptr}.
83488332
\tcode{get_deleter()} returns a reference
83498333
to the stored deleter that was constructed from
83508334
\tcode{u.get_deleter()}.
@@ -8387,13 +8371,14 @@
83878371
lvalue of type \tcode{D} shall not throw an exception.
83888372

83898373
\pnum
8390-
\effects
8391-
Transfers ownership from \tcode{u} to \tcode{*this} as if by calling
8392-
\tcode{reset(u.release())} followed by
8393-
\tcode{get_deleter() = std::forward<D>(u.get_deleter())}.
8374+
\effects Calls \tcode{reset(u.release())} followed by
8375+
\tcode{get_deleter() = std::forward<D>(u.get_dele\-ter())}.
83948376

83958377
\pnum
83968378
\returns \tcode{*this}.
8379+
8380+
\pnum
8381+
\postconditions \tcode{u.get() == nullptr}.
83978382
\end{itemdescr}
83988383

83998384
\indexlibrarymember{operator=}{unique_ptr}%
@@ -8418,12 +8403,14 @@
84188403
\end{itemize}
84198404

84208405
\pnum
8421-
\effects Transfers ownership from \tcode{u} to \tcode{*this} as if by calling
8422-
\tcode{reset(u.release())} followed by
8423-
\tcode{get_deleter() = std::forward<E>(u.get_deleter())}.
8406+
\effects Calls \tcode{reset(u.release())} followed by
8407+
\tcode{get_deleter() = std::forward<E>(u.get_dele\-ter())}.
84248408

84258409
\pnum
84268410
\returns \tcode{*this}.
8411+
8412+
\pnum
8413+
\postconditions \tcode{u.get() == nullptr}.
84278414
\end{itemdescr}
84288415

84298416
\indexlibrarymember{operator=}{unique_ptr}%

0 commit comments

Comments
 (0)