Skip to content

3403: Update P/R per reflector discussion #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 62 additions & 4 deletions xml/issue3403.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,63 @@ expression, I think it's an improvement?
<p>Priority to 2 after reflector discussion.</p>

<note>2020-07-22 Casey provides wording</note>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p>
This wording is relative to <a href="http://wg21.link/n4861">N4861</a>.
</p>

<ol>
<li><p>Add a new paragraph after paragraph 1 in <sref ref="[ranges.syn]"/>:</p>
<blockquote>
<ins>
-?- Also within this clause,
<tt><i>make-signed-like-t</i>&lt;X&gt;</tt>
for an integer-like type <tt>X</tt>
denotes <tt>make_signed_t&lt;X&gt;</tt>
if <tt>X</tt> is an integer type;
otherwise, it denotes a corresponding
unspecified signed-integer-like type
of the same width as <tt>X</tt>.
</ins>
</blockquote>
</li>

<li><p>Modify <sref ref="[range.prim.ssize]"/> as indicated:</p>

<blockquote>
<p>-1- The name <tt>ranges::ssize</tt> denotes
a customization point object (<sref ref="[customization.point.object]"/>).
<del>The expression <tt>ranges::ssize(E)</tt>
for a subexpression <tt>E</tt> of type <tt>T</tt>
is expression-equivalent to:</del>
</p><p>
<del>(1.1) &mdash; If <tt>range_difference_t&lt;T&gt;</tt> has
width less than <tt>ptrdiff_t</tt>,
<tt>static_cast&lt;ptrdiff_t&gt;(ranges::size(E))</tt>.</del>
</p><p>
<del>(1.2) &mdash; Otherwise,
<tt>static_cast&lt;range_difference_t&lt;T&gt;&gt;(ranges::size(E))</tt>.</del>
</p><p>
<ins>
-?- Given a subexpression <tt>E</tt> with type <tt>T</tt>,
let <tt>t</tt> be an lvalue that denotes the reified object for <tt>E</tt>.
If <tt>ranges::size(t)</tt> is ill-formed,
<tt>ranges::ssize(E)</tt> is ill-formed.
Otherwise, let <tt>D</tt> be the wider of
<tt>ptrdiff_t</tt> or <tt>decltype(ranges::size(t))</tt>;
<tt>ranges::ssize(E)</tt> is expression-equivalent to
<tt>static_cast&lt;<i>make-signed-like-t</i>&lt;D&gt;&gt;(ranges::size(t))</tt>.
</ins>
</p>
</blockquote>
</li>
</ol>
</blockquote>

<note>2020-07-31 Casey provides updated wording</note>
Per discussion on the reflector.
</discussion>

<resolution>
Expand All @@ -48,7 +105,7 @@ since we don't need it at this time.]
</blockquote>
<blockquote>
<ins>
-?- Also within this clause,
-?- Also within this Clause,
<tt><i>make-signed-like-t</i>&lt;X&gt;</tt>
for an integer-like type <tt>X</tt>
denotes <tt>make_signed_t&lt;X&gt;</tt>
Expand Down Expand Up @@ -81,10 +138,11 @@ width less than <tt>ptrdiff_t</tt>,
let <tt>t</tt> be an lvalue that denotes the reified object for <tt>E</tt>.
If <tt>ranges::size(t)</tt> is ill-formed,
<tt>ranges::ssize(E)</tt> is ill-formed.
Otherwise, let <tt>D</tt> be the wider of
<tt>ptrdiff_t</tt> or <tt>decltype(ranges::size(t))</tt>;
Otherwise let <tt>D</tt> be
<tt><i>make-signed-like-t</i>&lt;decltype(ranges::size(t))&gt;</tt>,
or <tt>ptrdiff_t</tt> if it is wider than that type;
<tt>ranges::ssize(E)</tt> is expression-equivalent to
<tt>static_cast&lt;<i>make-signed-like-t</i>&lt;D&gt;&gt;(ranges::size(t))</tt>.
<tt>static_cast&lt;D&gt;(ranges::size(t))</tt>.
</ins>
</p>
</blockquote>
Expand Down