From Jason Turner

[unique.ptr.runtime]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpoggi99pd/{from.md → to.md} +26 -26
tmp/tmpoggi99pd/{from.md → to.md} RENAMED
@@ -63,19 +63,20 @@ interface.
63
  Descriptions are provided below only for members that differ from the
64
  primary template.
65
 
66
  The template argument `T` shall be a complete type.
67
 
68
- ##### `unique_ptr` constructors <a id="unique.ptr.runtime.ctor">[[unique.ptr.runtime.ctor]]</a>
69
 
70
  ``` cpp
71
  template<class U> explicit unique_ptr(U p) noexcept;
72
  ```
73
 
74
  This constructor behaves the same as the constructor in the primary
75
- template that takes a single parameter of type `pointer` except that it
76
- additionally shall not participate in overload resolution unless
 
77
 
78
  - `U` is the same type as `pointer`, or
79
  - `pointer` is the same type as `element_type*`, `U` is a pointer type
80
  `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
81
 
@@ -83,70 +84,68 @@ additionally shall not participate in overload resolution unless
83
  template<class U> unique_ptr(U p, see below d) noexcept;
84
  template<class U> unique_ptr(U p, see below d) noexcept;
85
  ```
86
 
87
  These constructors behave the same as the constructors in the primary
88
- template that take a parameter of type `pointer` and a second parameter
89
- except that they shall not participate in overload resolution unless
90
- either
91
 
92
  - `U` is the same type as `pointer`,
93
  - `U` is `nullptr_t`, or
94
  - `pointer` is the same type as `element_type*`, `U` is a pointer type
95
  `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
96
 
97
  ``` cpp
98
- template <class U, class E>
99
- unique_ptr(unique_ptr<U, E>&& u) noexcept;
100
  ```
101
 
102
- This constructor behaves the same as in the primary template, except
103
- that it shall not participate in overload resolution unless all of the
104
- following conditions hold, where `UP` is `unique_ptr<U, E>`:
105
 
106
  - `U` is an array type, and
107
  - `pointer` is the same type as `element_type*`, and
108
  - `UP::pointer` is the same type as `UP::element_type*`, and
109
  - `UP::element_type(*)[]` is convertible to `element_type(*)[]`, and
110
  - either `D` is a reference type and `E` is the same type as `D`, or `D`
111
  is not a reference type and `E` is implicitly convertible to `D`.
112
 
113
- [*Note 1*: This replaces the overload-resolution specification of the
114
- primary template — *end note*]
115
 
116
- ##### `unique_ptr` assignment <a id="unique.ptr.runtime.asgn">[[unique.ptr.runtime.asgn]]</a>
117
 
118
  ``` cpp
119
- template <class U, class E>
120
- unique_ptr& operator=(unique_ptr<U, E>&& u)noexcept;
121
  ```
122
 
123
- This operator behaves the same as in the primary template, except that
124
- it shall not participate in overload resolution unless all of the
125
- following conditions hold, where `UP` is `unique_ptr<U, E>`:
126
 
127
  - `U` is an array type, and
128
  - `pointer` is the same type as `element_type*`, and
129
  - `UP::pointer` is the same type as `UP::element_type*`, and
130
  - `UP::element_type(*)[]` is convertible to `element_type(*)[]`, and
131
  - `is_assignable_v<D&, E&&>` is `true`.
132
 
133
- [*Note 2*: This replaces the overload-resolution specification of the
134
- primary template — *end note*]
135
 
136
- ##### `unique_ptr` observers <a id="unique.ptr.runtime.observers">[[unique.ptr.runtime.observers]]</a>
137
 
138
  ``` cpp
139
  T& operator[](size_t i) const;
140
  ```
141
 
142
- *Requires:* `i <` the number of elements in the array to which the
143
  stored pointer points.
144
 
145
  *Returns:* `get()[i]`.
146
 
147
- ##### `unique_ptr` modifiers <a id="unique.ptr.runtime.modifiers">[[unique.ptr.runtime.modifiers]]</a>
148
 
149
  ``` cpp
150
  void reset(nullptr_t p = nullptr) noexcept;
151
  ```
152
 
@@ -155,12 +154,13 @@ void reset(nullptr_t p = nullptr) noexcept;
155
  ``` cpp
156
  template<class U> void reset(U p) noexcept;
157
  ```
158
 
159
  This function behaves the same as the `reset` member of the primary
160
- template, except that it shall not participate in overload resolution
161
- unless either
 
162
 
163
  - `U` is the same type as `pointer`, or
164
  - `pointer` is the same type as `element_type*`, `U` is a pointer type
165
  `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
166
 
 
63
  Descriptions are provided below only for members that differ from the
64
  primary template.
65
 
66
  The template argument `T` shall be a complete type.
67
 
68
+ ##### Constructors <a id="unique.ptr.runtime.ctor">[[unique.ptr.runtime.ctor]]</a>
69
 
70
  ``` cpp
71
  template<class U> explicit unique_ptr(U p) noexcept;
72
  ```
73
 
74
  This constructor behaves the same as the constructor in the primary
75
+ template that takes a single parameter of type `pointer`.
76
+
77
+ *Constraints:*
78
 
79
  - `U` is the same type as `pointer`, or
80
  - `pointer` is the same type as `element_type*`, `U` is a pointer type
81
  `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
82
 
 
84
  template<class U> unique_ptr(U p, see below d) noexcept;
85
  template<class U> unique_ptr(U p, see below d) noexcept;
86
  ```
87
 
88
  These constructors behave the same as the constructors in the primary
89
+ template that take a parameter of type `pointer` and a second parameter.
90
+
91
+ *Constraints:*
92
 
93
  - `U` is the same type as `pointer`,
94
  - `U` is `nullptr_t`, or
95
  - `pointer` is the same type as `element_type*`, `U` is a pointer type
96
  `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
97
 
98
  ``` cpp
99
+ template<class U, class E> unique_ptr(unique_ptr<U, E>&& u) noexcept;
 
100
  ```
101
 
102
+ This constructor behaves the same as in the primary template.
103
+
104
+ *Constraints:* Where `UP` is `unique_ptr<U, E>`:
105
 
106
  - `U` is an array type, and
107
  - `pointer` is the same type as `element_type*`, and
108
  - `UP::pointer` is the same type as `UP::element_type*`, and
109
  - `UP::element_type(*)[]` is convertible to `element_type(*)[]`, and
110
  - either `D` is a reference type and `E` is the same type as `D`, or `D`
111
  is not a reference type and `E` is implicitly convertible to `D`.
112
 
113
+ [*Note 1*: This replaces the *Constraints:* specification of the
114
+ primary template. — *end note*]
115
 
116
+ ##### Assignment <a id="unique.ptr.runtime.asgn">[[unique.ptr.runtime.asgn]]</a>
117
 
118
  ``` cpp
119
+ template<class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u)noexcept;
 
120
  ```
121
 
122
+ This operator behaves the same as in the primary template.
123
+
124
+ *Constraints:* Where `UP` is `unique_ptr<U, E>`:
125
 
126
  - `U` is an array type, and
127
  - `pointer` is the same type as `element_type*`, and
128
  - `UP::pointer` is the same type as `UP::element_type*`, and
129
  - `UP::element_type(*)[]` is convertible to `element_type(*)[]`, and
130
  - `is_assignable_v<D&, E&&>` is `true`.
131
 
132
+ [*Note 2*: This replaces the *Constraints:* specification of the
133
+ primary template. — *end note*]
134
 
135
+ ##### Observers <a id="unique.ptr.runtime.observers">[[unique.ptr.runtime.observers]]</a>
136
 
137
  ``` cpp
138
  T& operator[](size_t i) const;
139
  ```
140
 
141
+ *Preconditions:* `i` < the number of elements in the array to which the
142
  stored pointer points.
143
 
144
  *Returns:* `get()[i]`.
145
 
146
+ ##### Modifiers <a id="unique.ptr.runtime.modifiers">[[unique.ptr.runtime.modifiers]]</a>
147
 
148
  ``` cpp
149
  void reset(nullptr_t p = nullptr) noexcept;
150
  ```
151
 
 
154
  ``` cpp
155
  template<class U> void reset(U p) noexcept;
156
  ```
157
 
158
  This function behaves the same as the `reset` member of the primary
159
+ template.
160
+
161
+ *Constraints:*
162
 
163
  - `U` is the same type as `pointer`, or
164
  - `pointer` is the same type as `element_type*`, `U` is a pointer type
165
  `V*`, and `V(*)[]` is convertible to `element_type(*)[]`.
166