Skip to content

Commit 781374b

Browse files
jensmaurerzygoloid
authored andcommitted
[unique.ptr.single.ctor] Simplify description of unique_ptr constructors
1 parent a297a3d commit 781374b

File tree

1 file changed

+5
-31
lines changed

1 file changed

+5
-31
lines changed

source/utilities.tex

+5-31
Original file line numberDiff line numberDiff line change
@@ -8216,39 +8216,11 @@
82168216

82178217
\indexlibrary{\idxcode{unique_ptr}!constructor}%
82188218
\begin{itemdecl}
8219-
unique_ptr(pointer p, @\seebelow@ d1) noexcept;
8220-
unique_ptr(pointer p, @\seebelow@ d2) noexcept;
8219+
unique_ptr(pointer p, const D& d) noexcept;
8220+
unique_ptr(pointer p, remove_reference_t<D>&& d) noexcept;
82218221
\end{itemdecl}
82228222

82238223
\begin{itemdescr}
8224-
\pnum
8225-
The signature of these constructors depends upon whether \tcode{D}
8226-
is a reference type. If \tcode{D} is a non-reference type
8227-
\tcode{A}, then the signatures are:
8228-
8229-
\begin{codeblock}
8230-
unique_ptr(pointer p, const A& d) noexcept;
8231-
unique_ptr(pointer p, A&& d) noexcept;
8232-
\end{codeblock}
8233-
8234-
\pnum
8235-
If \tcode{D} is an lvalue reference type \tcode{A\&},
8236-
then the signatures are:
8237-
8238-
\begin{codeblock}
8239-
unique_ptr(pointer p, A& d) noexcept;
8240-
unique_ptr(pointer p, A&& d) = delete;
8241-
\end{codeblock}
8242-
8243-
\pnum
8244-
If \tcode{D} is an lvalue reference type \tcode{const A\&},
8245-
then the signatures are:
8246-
8247-
\begin{codeblock}
8248-
unique_ptr(pointer p, const A& d) noexcept;
8249-
unique_ptr(pointer p, const A&& d) = delete;
8250-
\end{codeblock}
8251-
82528224
\pnum
82538225
\requires For the first constructor, if \tcode{D} is not a reference type,
82548226
\tcode{D} shall satisfy the \oldconcept{CopyConstructible} requirements and
@@ -8263,7 +8235,9 @@
82638235
from \tcode{std::forward<decltype(d)>(d)}.
82648236

82658237
\pnum
8266-
\remarks These constructors shall not participate in overload resolution
8238+
\remarks If \tcode{D} is a reference type,
8239+
the second constructor is defined as deleted.
8240+
These constructors shall not participate in overload resolution
82678241
unless \tcode{is_constructible_v<D, decltype(d)>} is \tcode{true}.
82688242

82698243
\pnum

0 commit comments

Comments
 (0)