@@ -86,9 +86,8 @@ of bytes) does not allow implementations to do such patching, and the code
86
86
is going to fail at runtime. Therefore this case also needs to be discussed by
87
87
`std::trivially_relocate`'s specification.
88
88
</p >
89
- </discussion >
90
89
91
- <resolution >
90
+ <superseded >
92
91
<p >
93
92
This wording is relative to <paper num =" N5008" />.
94
93
</p >
@@ -145,6 +144,68 @@ it is implementation-defined whether the behavior is undefined.</ins>
145
144
</blockquote >
146
145
</li >
147
146
147
+ </ol >
148
+ </superseded >
149
+
150
+ <note >2025-07-01; Pablo and Giuseppe improve wording</note >
151
+ </discussion >
152
+
153
+ <resolution >
154
+ <p >
155
+ This wording is relative to <paper num =" N5008" />.
156
+ </p >
157
+
158
+ <ol >
159
+ <li ><p >Modify <sref ref =" [obj.lifetime]" /> as indicated:</p >
160
+
161
+ <blockquote class =" note" >
162
+ <p >
163
+ [<i >Drafting note</i >: For the general part of the issue (all objects in the range must be of
164
+ trivially relocatable type), we append another point at the end of the existing
165
+ <i >Preconditions:</i > element of `trivially_relocate`.<br />
166
+ For the specifics of polymorphic types, we amend at the end of the description the existing
167
+ <i >Remarks</i >: element]
168
+ </p >
169
+ </blockquote >
170
+
171
+ <blockquote >
172
+ <pre >
173
+ template< class T>
174
+ T* trivially_relocate(T* first, T* last, T* result);
175
+ </pre >
176
+ <blockquote >
177
+ <p >
178
+ -9- <i >Mandates</i >: [… ]
179
+ <p />
180
+ -10- <i >Preconditions</i >:
181
+ </p >
182
+ <ol style =" list-style-type: none" >
183
+ <li ><p >(10.1) — `[first, last)` is a valid range.</p ></li >
184
+ <li ><p >(10.2) — `[result, result + (last - first))` denotes a region of storage that is a subset of the region
185
+ reachable through `result` (<sref ref =" [basic.compound]" />) and suitably aligned for the type `T`.</p ></li >
186
+ <li ><p >(10.3) — No element in the range `[first, last)` is a potentially-overlapping subobject.</p ></li >
187
+ <li ><p ><ins >(10.?) — All objects whose storage is being provided for (<sref ref =" [intro.object]" />) by
188
+ objects in the `[first, last)` range are of a type such that a union containing a non-static member of that type
189
+ would be eligible for trivial relocation.</ins ></p ></li >
190
+ </ol >
191
+ <p >
192
+ -11- <i >Postconditions</i >: [… ]
193
+ <p />
194
+ -12- <i >Returns</i >: `result + (last - first)`.
195
+ <p />
196
+ -13- <i >Throws</i >: Nothing.
197
+ <p />
198
+ -14- <i >Complexity</i >: Linear in the length of the source range.
199
+ <p />
200
+ -15- <i >Remarks</i >: The destination region of storage is considered reused (<sref ref =" [basic.life]" />).
201
+ No constructors or destructors are invoked.
202
+ <p />
203
+ [<i >Note 2</i >: Overlapping ranges are supported. — <i >end note</i >]
204
+ </p >
205
+ </blockquote >
206
+ </blockquote >
207
+ </li >
208
+
148
209
</ol >
149
210
</resolution >
150
211
0 commit comments