forked from lwg/issues
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New issue from Arthur: ""Effects: Equivalent to return" in [span.elem]"
- Loading branch information
Showing
1 changed file
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version='1.0' encoding='utf-8' standalone='no'?> | ||
<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> | ||
|
||
<issue num="4011" status="New"> | ||
<title>"<i>Effects</i>: Equivalent to return" in [span.elem]</title> | ||
<section><sref ref="[span.elem]"/></section> | ||
<submitter>Arthur O'Dwyer</submitter> | ||
<date>09 Nov 2023</date> | ||
<priority>99</priority> | ||
|
||
<discussion> | ||
<p> | ||
In reviewing the wording for <paper num="P2821"/> <tt>span.at()</tt>, it had been noticed that | ||
<sref ref="[span.elem]"/> uses a lot of "<i>Effects</i>: Equivalent to return […];" which | ||
could be simply "<i>Returns</i>: […]". | ||
<p/> | ||
For comparison, <sref ref="[string.view.access]"/> uses "<i>Returns</i>: ..." instead, so I | ||
suggest that <sref ref="[span.elem]"/> should be consistent with that. | ||
</p> | ||
</discussion> | ||
|
||
<resolution> | ||
<p> | ||
This wording is relative to <paper num="N4964"/>. | ||
</p> | ||
|
||
<ol> | ||
|
||
<li><p>Modify <sref ref="[span.elem]"/> as indicated:</p> | ||
|
||
<pre> | ||
constexpr reference operator[](size_type idx) const; | ||
</pre> | ||
<blockquote> | ||
<p> | ||
-1- <i>Preconditions</i>: <tt>idx < size()</tt> is <tt>true</tt>. | ||
<p/> | ||
-2- <i><del>Effects</del><ins>Returns</ins></i>: <del>Equivalent to:</del> <tt><del>return</del> *(data() + idx)<del>;</del></tt><ins>.</ins> | ||
<p/> | ||
<ins>-?- <i>Throws</i>: Nothing.</ins> | ||
</p> | ||
</blockquote> | ||
<pre> | ||
constexpr reference front() const; | ||
</pre> | ||
<blockquote> | ||
<p> | ||
-3- <i>Preconditions</i>: <tt>empty()</tt> is <tt>false</tt>. | ||
<p/> | ||
-4- <i><del>Effects</del><ins>Returns</ins></i>: <del>Equivalent to:</del> <tt><del>return</del> *data()<del>;</del></tt><ins>.</ins> | ||
<p/> | ||
<ins>-?- <i>Throws</i>: Nothing.</ins> | ||
</p> | ||
</blockquote> | ||
<pre> | ||
constexpr reference back() const; | ||
</pre> | ||
<blockquote> | ||
<p> | ||
-5- <i>Preconditions</i>: <tt>empty()</tt> is <tt>false</tt>. | ||
<p/> | ||
-6- <i><del>Effects</del><ins>Returns</ins></i>: <del>Equivalent to:</del> <tt><del>return</del> *(data() + (size() - 1))<del>;</del></tt><ins>.</ins> | ||
<p/> | ||
<ins>-?- <i>Throws</i>: Nothing.</ins> | ||
</p> | ||
</blockquote> | ||
<pre> | ||
constexpr pointer data() const noexcept; | ||
</pre> | ||
<blockquote> | ||
<p> | ||
-7- <i><del>Effects</del><ins>Returns</ins></i>: <del>Equivalent to:</del> <tt><del>return</del> <i>data_</i><del>;</del></tt><ins>.</ins> | ||
</p> | ||
</blockquote> | ||
|
||
</li> | ||
|
||
</ol> | ||
</resolution> | ||
|
||
</issue> |