From Jason Turner

[unique.ptr.runtime.ctor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpji01f310/{from.md → to.md} +42 -7
tmp/tmpji01f310/{from.md → to.md} RENAMED
@@ -1,13 +1,48 @@
1
  ##### `unique_ptr` constructors <a id="unique.ptr.runtime.ctor">[[unique.ptr.runtime.ctor]]</a>
2
 
3
  ``` cpp
4
- explicit unique_ptr(pointer p) noexcept;
5
- unique_ptr(pointer p, see below d) noexcept;
6
- unique_ptr(pointer p, see below d) noexcept;
7
  ```
8
 
9
- These constructors behave the same as in the primary template except
10
- that they do not accept pointer types which are convertible to
11
- `pointer`. One implementation technique is to create private templated
12
- overloads of these members.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
 
1
  ##### `unique_ptr` constructors <a id="unique.ptr.runtime.ctor">[[unique.ptr.runtime.ctor]]</a>
2
 
3
  ``` cpp
4
+ template <class U> explicit unique_ptr(U p) noexcept;
 
 
5
  ```
6
 
7
+ This constructor behaves the same as the constructor in the primary
8
+ template that takes a single parameter of type `pointer` except that it
9
+ additionally shall not participate in overload resolution unless
10
+
11
+ - `U` is the same type as `pointer`, or
12
+ - `pointer` is the same type as `element_type*`, `U` is a pointer type
13
+ `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
14
+
15
+ ``` cpp
16
+ template <class U> unique_ptr(U p, see below d) noexcept;
17
+ template <class U> unique_ptr(U p, see below d) noexcept;
18
+ ```
19
+
20
+ These constructors behave the same as the constructors in the primary
21
+ template that take a parameter of type `pointer` and a second parameter
22
+ except that they shall not participate in overload resolution unless
23
+ either
24
+
25
+ - `U` is the same type as `pointer`,
26
+ - `U` is `nullptr_t`, or
27
+ - `pointer` is the same type as `element_type*`, `U` is a pointer type
28
+ `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
29
+
30
+ ``` cpp
31
+ template <class U, class E>
32
+ unique_ptr(unique_ptr<U, E>&& u) noexcept;
33
+ ```
34
+
35
+ This constructor behaves the same as in the primary template, except
36
+ that it shall not participate in overload resolution unless all of the
37
+ following conditions hold, where `UP` is `unique_ptr<U, E>`:
38
+
39
+ - `U` is an array type, and
40
+ - `pointer` is the same type as `element_type*`, and
41
+ - `UP::pointer` is the same type as `UP::element_type*`, and
42
+ - `UP::element_type(*)[]` is convertible to `element_type(*)[]`, and
43
+ - either `D` is a reference type and `E` is the same type as `D`, or `D`
44
+ is not a reference type and `E` is implicitly convertible to `D`.
45
+
46
+ [*Note 1*: This replaces the overload-resolution specification of the
47
+ primary template — *end note*]
48