Skip to content

Commit 605a7a0

Browse files
committed
Pablo and Giuseppe provide improved wording
1 parent dfd78d7 commit 605a7a0

File tree

1 file changed

+63
-2
lines changed

1 file changed

+63
-2
lines changed

xml/issue4283.xml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ of bytes) does not allow implementations to do such patching, and the code
8686
is going to fail at runtime. Therefore this case also needs to be discussed by
8787
`std::trivially_relocate`'s specification.
8888
</p>
89-
</discussion>
9089

91-
<resolution>
90+
<superseded>
9291
<p>
9392
This wording is relative to <paper num="N5008"/>.
9493
</p>
@@ -145,6 +144,68 @@ it is implementation-defined whether the behavior is undefined.</ins>
145144
</blockquote>
146145
</li>
147146

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&lt;class T&gt;
174+
T* trivially_relocate(T* first, T* last, T* result);
175+
</pre>
176+
<blockquote>
177+
<p>
178+
-9- <i>Mandates</i>: [&hellip;]
179+
<p/>
180+
-10- <i>Preconditions</i>:
181+
</p>
182+
<ol style="list-style-type: none">
183+
<li><p>(10.1) &mdash; `[first, last)` is a valid range.</p></li>
184+
<li><p>(10.2) &mdash; `[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) &mdash; No element in the range `[first, last)` is a potentially-overlapping subobject.</p></li>
187+
<li><p><ins>(10.?) &mdash; 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>: [&hellip;]
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. &mdash; <i>end note</i>]
204+
</p>
205+
</blockquote>
206+
</blockquote>
207+
</li>
208+
148209
</ol>
149210
</resolution>
150211

0 commit comments

Comments
 (0)