|
8216 | 8216 |
|
8217 | 8217 | \indexlibrary{\idxcode{unique_ptr}!constructor}%
|
8218 | 8218 | \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; |
8221 | 8221 | \end{itemdecl}
|
8222 | 8222 |
|
8223 | 8223 | \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 |
| - |
8252 | 8224 | \pnum
|
8253 | 8225 | \requires For the first constructor, if \tcode{D} is not a reference type,
|
8254 | 8226 | \tcode{D} shall satisfy the \oldconcept{CopyConstructible} requirements and
|
|
8263 | 8235 | from \tcode{std::forward<decltype(d)>(d)}.
|
8264 | 8236 |
|
8265 | 8237 | \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 |
8267 | 8241 | unless \tcode{is_constructible_v<D, decltype(d)>} is \tcode{true}.
|
8268 | 8242 |
|
8269 | 8243 | \pnum
|
|
0 commit comments