<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3335: Resolve C++20 NB comments US 273 and GB 274</title>
<meta property="og:title" content="Issue 3335: Resolve C++20 NB comments US 273 and GB 274">
<meta property="og:description" content="C++ library issue. Status: C++20">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3335.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++20">C++20</a> status.</em></p>
<h3 id="3335"><a href="lwg-defects.html#3335">3335</a>. Resolve C++20 NB comments US 273 and GB 274</h3>
<p><b>Section:</b> 25.2 <a href="https://wg21.link/ranges.syn">[ranges.syn]</a> <b>Status:</b> <a href="lwg-active.html#C++20">C++20</a>
 <b>Submitter:</b> United States/Great Britain <b>Opened:</b> 2019-11-08 <b>Last modified:</b> 2021-02-25</p>
<p><b>Priority: </b>1
</p>
<p><b>View other</b> <a href="lwg-index-open.html#ranges.syn">active issues</a> in [ranges.syn].</p>
<p><b>View all other</b> <a href="lwg-index.html#ranges.syn">issues</a> in [ranges.syn].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++20">C++20</a> status.</p>
<p><b>Discussion:</b></p>
<p><b>Addresses <a href="https://github.com/cplusplus/nbballot/issues/269">US 273</a>/<a href="https://github.com/cplusplus/nbballot/issues/270">GB 274</a></b></p>

<p>
<b><a href="https://github.com/cplusplus/nbballot/issues/269">US 273</a>:</b>
<p/>
<code>all_view</code> is not a view like the others. For the other view types, <code>foo_view{args...}</code> is a valid
way to construct an instance of type foo_view. However, <code>all_view</code> is just an alias to the type of 
<code>view::all(arg)</code>, which could be one of several different types. <code>all_view</code> feels like the wrong name.
<p/>
Proposed change:
<p/>
Suggest renaming <code>all_view</code> to <code>all_t</code> and
moving it into the <code>views::</code> namespace.
</p>

<p>
<b><a href="https://github.com/cplusplus/nbballot/issues/270">GB 274</a>:</b>
<p/>
Add <code>range_size_t</code>.
<p/>
LEWG asked that <code>range_size_t</code> be removed from <a href="https://wg21.link/p1035">P1035</a>, 
as they were doing a good job of being neutral w.r.t whether or not size-types were signed or 
unsigned at the time. Now that we've got a policy on what size-types are, and that 
<a href="https://wg21.link/p1522">P1522</a> and <a href="https://wg21.link/p1523">P1523</a> 
have been adopted, it makes sense for there to be a <code>range_size_t</code>.
<p/>
Proposed change:
<p/>
Add to [ranges.syn]:
</p>
<blockquote><pre>
template&lt;range R&gt;
  using range_difference_t = iter_difference_t&lt;iterator_t&lt;R&gt;&gt;;
<ins>template&lt;sized_range R&gt;
  using range_size_t = decltype(ranges::size(declval&lt;R&amp;&gt;()));</ins>
</pre></blockquote>
<p>
<b>David Olsen:</b>
<p/>
The proposed wording has been approved by LEWG and LWG in Belfast.
</p>

<p><i>[2019-11-23 Issue Prioritization]</i></p>

<p>Priority to 1 after reflector discussion.</p>

<p><i>[2020-02-10 Move to Immediate Monday afternoon in Prague]</i></p>



<p id="res-3335"><b>Proposed resolution:</b></p>
<p>This wording is relative to <a href="https://wg21.link/n4835">N4835</a>.</p>

<ol>
<li><p>Change 25.2 <a href="https://wg21.link/ranges.syn">[ranges.syn]</a>, header <code>&lt;ranges&gt;</code> synopsis, as indicated:</p>

<blockquote>
<pre>
#include &lt;initializer_list&gt;
#include &lt;iterator&gt;

namespace std::ranges {
  [&hellip;]
  <i>// 25.4.2 <a href="https://wg21.link/range.range">[range.range]</a>, ranges</i>
  template&lt;class T&gt;
  concept range = <i>see below</i>;
  [&hellip;]
  template&lt;range R&gt;
    using range_difference_t = iter_difference_t&lt;iterator_t&lt;R&gt;&gt;;
  <ins>template&lt;sized_range R&gt;
    using range_size_t = decltype(ranges::size(declval&lt;R&amp;&gt;()));</ins>
  template&lt;range R&gt;
    using range_value_t = iter_value_t&lt;iterator_t&lt;R&gt;&gt;;
  [&hellip;]
  <i>// 25.7.6.2 <a href="https://wg21.link/range.ref.view">[range.ref.view]</a>, all view</i>
  namespace views { <del>inline constexpr <i>unspecified</i> all = <i>unspecified</i>; }</del>
    <ins>inline constexpr <i>unspecified</i> all = <i>unspecified</i>;</ins>

    template&lt;viewable_range R&gt;
      using all_<ins>t</ins><del>view</del> = decltype(<del>views::</del>all(declval&lt;R&gt;()));
  <ins>}</ins>
  [&hellip;]
}
</pre>
</blockquote>
</li>

<li><p>Globally replace all occurrences of <code>all_view</code> with <code>views::all_t</code>. There are 36 
occurrences in addition to the definition in the <code>&lt;ranges&gt;</code> synopsis that was changed above.</p>
</li>
</ol>




</body>
</html>
