Skip to content

Commit

Permalink
New issue from Arthur: ""Effects: Equivalent to return" in [span.elem]"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani-Hub committed Nov 18, 2023
1 parent a033c86 commit 382cf5f
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions xml/issue4011.xml
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 [&hellip;];" which
could be simply "<i>Returns</i>: [&hellip;]".
<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 &lt; 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>

0 comments on commit 382cf5f

Please sign in to comment.