From Jason Turner

[unique.ptr.single.ctor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpeplhj4sa/{from.md → to.md} +8 -14
tmp/tmpeplhj4sa/{from.md → to.md} RENAMED
@@ -3,33 +3,30 @@
3
  ``` cpp
4
  constexpr unique_ptr() noexcept;
5
  constexpr unique_ptr(nullptr_t) noexcept;
6
  ```
7
 
 
 
 
8
  *Preconditions:* `D` meets the *Cpp17DefaultConstructible* requirements
9
  ([[cpp17.defaultconstructible]]), and that construction does not throw
10
  an exception.
11
 
12
- *Constraints:* `is_pointer_v<deleter_type>` is `false` and
13
- `is_default_constructible_v<deleter_type>` is `true`.
14
-
15
  *Effects:* Constructs a `unique_ptr` object that owns nothing,
16
  value-initializing the stored pointer and the stored deleter.
17
 
18
  *Ensures:* `get() == nullptr`. `get_deleter()` returns a reference to
19
  the stored deleter.
20
 
21
  ``` cpp
22
- explicit unique_ptr(pointer p) noexcept;
23
  ```
24
 
25
  *Constraints:* `is_pointer_v<deleter_type>` is `false` and
26
  `is_default_constructible_v<deleter_type>` is `true`.
27
 
28
- *Mandates:* This constructor is not selected by class template argument
29
- deduction [[over.match.class.deduct]].
30
-
31
  *Preconditions:* `D` meets the *Cpp17DefaultConstructible* requirements
32
  ([[cpp17.defaultconstructible]]), and that construction does not throw
33
  an exception.
34
 
35
  *Effects:* Constructs a `unique_ptr` which owns `p`, initializing the
@@ -37,19 +34,16 @@ stored pointer with `p` and value-initializing the stored deleter.
37
 
38
  *Ensures:* `get() == p`. `get_deleter()` returns a reference to the
39
  stored deleter.
40
 
41
  ``` cpp
42
- unique_ptr(pointer p, const D& d) noexcept;
43
- unique_ptr(pointer p, remove_reference_t<D>&& d) noexcept;
44
  ```
45
 
46
  *Constraints:* `is_constructible_v<D, decltype(d)>` is `true`.
47
 
48
- *Mandates:* These constructors are not selected by class template
49
- argument deduction [[over.match.class.deduct]].
50
-
51
  *Preconditions:* For the first constructor, if `D` is not a reference
52
  type, `D` meets the *Cpp17CopyConstructible* requirements and such
53
  construction does not exit via an exception. For the second constructor,
54
  if `D` is not a reference type, `D` meets the *Cpp17MoveConstructible*
55
  requirements and such construction does not exit via an exception.
@@ -77,11 +71,11 @@ unique_ptr<int, const D&> p4(new int, D()); // error: rvalue deleter object comb
77
  ```
78
 
79
  — *end example*]
80
 
81
  ``` cpp
82
- unique_ptr(unique_ptr&& u) noexcept;
83
  ```
84
 
85
  *Constraints:* `is_move_constructible_v<D>` is `true`.
86
 
87
  *Preconditions:* If `D` is not a reference type, `D` meets the
@@ -101,11 +95,11 @@ construction. `u.get() == nullptr`. `get_deleter()` returns a reference
101
  to the stored deleter that was constructed from `u.get_deleter()`. If
102
  `D` is a reference type then `get_deleter()` and `u.get_deleter()` both
103
  reference the same lvalue deleter.
104
 
105
  ``` cpp
106
- template<class U, class E> unique_ptr(unique_ptr<U, E>&& u) noexcept;
107
  ```
108
 
109
  *Constraints:*
110
 
111
  - `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer`,
 
3
  ``` cpp
4
  constexpr unique_ptr() noexcept;
5
  constexpr unique_ptr(nullptr_t) noexcept;
6
  ```
7
 
8
+ *Constraints:* `is_pointer_v<deleter_type>` is `false` and
9
+ `is_default_constructible_v<deleter_type>` is `true`.
10
+
11
  *Preconditions:* `D` meets the *Cpp17DefaultConstructible* requirements
12
  ([[cpp17.defaultconstructible]]), and that construction does not throw
13
  an exception.
14
 
 
 
 
15
  *Effects:* Constructs a `unique_ptr` object that owns nothing,
16
  value-initializing the stored pointer and the stored deleter.
17
 
18
  *Ensures:* `get() == nullptr`. `get_deleter()` returns a reference to
19
  the stored deleter.
20
 
21
  ``` cpp
22
+ constexpr explicit unique_ptr(type_identity_t<pointer> p) noexcept;
23
  ```
24
 
25
  *Constraints:* `is_pointer_v<deleter_type>` is `false` and
26
  `is_default_constructible_v<deleter_type>` is `true`.
27
 
 
 
 
28
  *Preconditions:* `D` meets the *Cpp17DefaultConstructible* requirements
29
  ([[cpp17.defaultconstructible]]), and that construction does not throw
30
  an exception.
31
 
32
  *Effects:* Constructs a `unique_ptr` which owns `p`, initializing the
 
34
 
35
  *Ensures:* `get() == p`. `get_deleter()` returns a reference to the
36
  stored deleter.
37
 
38
  ``` cpp
39
+ constexpr unique_ptr(type_identity_t<pointer> p, const D& d) noexcept;
40
+ constexpr unique_ptr(type_identity_t<pointer> p, remove_reference_t<D>&& d) noexcept;
41
  ```
42
 
43
  *Constraints:* `is_constructible_v<D, decltype(d)>` is `true`.
44
 
 
 
 
45
  *Preconditions:* For the first constructor, if `D` is not a reference
46
  type, `D` meets the *Cpp17CopyConstructible* requirements and such
47
  construction does not exit via an exception. For the second constructor,
48
  if `D` is not a reference type, `D` meets the *Cpp17MoveConstructible*
49
  requirements and such construction does not exit via an exception.
 
71
  ```
72
 
73
  — *end example*]
74
 
75
  ``` cpp
76
+ constexpr unique_ptr(unique_ptr&& u) noexcept;
77
  ```
78
 
79
  *Constraints:* `is_move_constructible_v<D>` is `true`.
80
 
81
  *Preconditions:* If `D` is not a reference type, `D` meets the
 
95
  to the stored deleter that was constructed from `u.get_deleter()`. If
96
  `D` is a reference type then `get_deleter()` and `u.get_deleter()` both
97
  reference the same lvalue deleter.
98
 
99
  ``` cpp
100
+ template<class U, class E> constexpr unique_ptr(unique_ptr<U, E>&& u) noexcept;
101
  ```
102
 
103
  *Constraints:*
104
 
105
  - `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer`,