<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta charset="utf-8">
<title>C++ Standard Library Immediate Issues to be moved in Kona, Nov. 2022</title>
<style type="text/css">
  p {text-align:justify}
  li {text-align:justify}
  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 {border-collapse: collapse;}
</style>
</head>
<body>
<h1>C++ Standard Library Immediate Issues to be moved in Kona, Nov. 2022</h1>
<table>
<tr>
<td align="left">Doc. no.</td>
<td align="left">P2704R0</td>
</tr>
<tr>
<td align="left">Date:</td>
<td align="left"><p>2022-11-11</p>
</td>
</tr>
<tr>
<td align="left">Audience:</td>
<td align="left">WG21</td>
</tr>
<tr>
<td align="left">Reply to:</td>
<td align="left">Jonathan Wakely &lt;<a href="mailto:lwgchair@gmail.com">lwgchair@gmail.com</a>&gt;</td>
</tr>
</table>
<h2 id="immediate">Immediate Issues</h2>
<hr>
<h3><a name="3515" href="https://cplusplus.github.io/LWG/lwg-active.html#3515">3515</a>. &sect;[stacktrace.basic.nonmem]: <tt>operator&lt;&lt;</tt> should be less templatized</h3>
<p><b>Section:</b> 19.6.2 <a href="https://wg21.link/stacktrace.syn">[stacktrace.syn]</a>, 19.6.4.6 <a href="https://wg21.link/stacktrace.basic.nonmem">[stacktrace.basic.nonmem]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Jiang An <b>Opened:</b> 2021-01-25 <b>Last modified:</b> 2022-11-09</p>
<p><b>Priority: </b>2
</p>
<p><b>View other</b> <a href="https://cplusplus.github.io/LWG/lwg-index-open.html#stacktrace.syn">active issues</a> in [stacktrace.syn].</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#stacktrace.syn">issues</a> in [stacktrace.syn].</p>
<p><b>Discussion:</b></p>
<p>
According to 23.4.4.4 <a href="https://wg21.link/string.io">[string.io]</a>, the <tt>operator&lt;&lt;</tt> overloads in 
19.6.4.6 <a href="https://wg21.link/stacktrace.basic.nonmem">[stacktrace.basic.nonmem]</a> are well-formed only if the template parameters 
<tt>charT</tt> and <tt>traits</tt> are <tt>char</tt> and <tt>std::char_traits&lt;char&gt;</tt> 
(that of <tt>std::string</tt>) respectively, because it is required in <i>Effects:</i> that 
these overloads behave as-if insert a <tt>std::string</tt>.
</p><p>
I think the declarations of these overloads should be changed to:
</p>
<blockquote><pre>
ostream&amp; operator&lt;&lt;(ostream&amp; os, const stacktrace_entry&amp; f); 

template&lt;class Allocator&gt;
ostream&amp; operator&lt;&lt;(ostream&amp; os, const basic_stacktrace&lt;Allocator&gt;&amp; st);
</pre></blockquote>

<p><i>[2021-03-12; Reflector poll]</i></p>

<p>
Set priority to 2 and status to LEWG following reflector poll.
</p>

<p><i>[2022-11-07; Kona]</i></p>

<p>Move to Immediate.</p>



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

<ol>
<li><p>Modify 19.6.2 <a href="https://wg21.link/stacktrace.syn">[stacktrace.syn]</a>, header <tt>&lt;stacktrace&gt;</tt> synopsis, as indicated:</p>

<blockquote><pre>
namespace std {
  <i>// 19.6.3 <a href="https://wg21.link/stacktrace.entry">[stacktrace.entry]</a>, class stacktrace_entry</i>
  class stacktrace_entry;
  
  <i>// 19.6.4 <a href="https://wg21.link/stacktrace.basic">[stacktrace.basic]</a>, class template basic_stacktrace</i>
  template&lt;class Allocator&gt;
  class basic_stacktrace;
  
  [&hellip;]
  
  <i>// 19.6.4.6 <a href="https://wg21.link/stacktrace.basic.nonmem">[stacktrace.basic.nonmem]</a>, non-member functions</i>
  [&hellip;]
  
  string to_string(const stacktrace_entry&amp; f);
  
  template&lt;class Allocator&gt;
    string to_string(const basic_stacktrace&lt;Allocator&gt;&amp; st);
  
  <del>template&lt;class charT, class traits&gt;
    basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp;
      operator&lt;&lt;(<del>basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp; os, const stacktrace_entry&amp; f);
    
  template&lt;<del>class charT, class traits, </del>class Allocator&gt;
    <del>basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp;
      operator&lt;&lt;(<del>basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp; os, const basic_stacktrace&lt;Allocator&gt;&amp; st);
  
  [&hellip;]
}
</pre></blockquote>
</li>

<li><p>Modify 19.6.4.6 <a href="https://wg21.link/stacktrace.basic.nonmem">[stacktrace.basic.nonmem]</a> as indicated:</p>

<blockquote>
<pre>
<del>template&lt;class charT, class traits&gt;
basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp;
  operator&lt;&lt;(<del>basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp; os, const stacktrace_entry&amp; f);
</pre>
<blockquote>
<p>
-4- <i>Effects:</i> Equivalent to: <tt>return os &lt;&lt; to_string(f);</tt>
</p>
</blockquote>
<pre>
template&lt;<del>class charT, class traits, </del>class Allocator&gt;
<del>basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp;
  operator&lt;&lt;(<del>basic_</del>ostream<del>&lt;charT, traits&gt;</del>&amp; os, const basic_stacktrace&lt;Allocator&gt;&amp; st);
</pre>
<blockquote>
<p>
-5- <i>Effects:</i> Equivalent to: <tt>return os &lt;&lt; to_string(st);</tt>
</p>
</blockquote>
</blockquote>
</li>
</ol>





<hr>
<h3><a name="3569" href="https://cplusplus.github.io/LWG/lwg-active.html#3569">3569</a>. <tt>join_view</tt> fails to support ranges of ranges with non-<tt>default_initializable</tt> iterators</h3>
<p><b>Section:</b> 26.7.14.3 <a href="https://wg21.link/range.join.iterator">[range.join.iterator]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Casey Carter <b>Opened:</b> 2021-06-16 <b>Last modified:</b> 2022-11-11</p>
<p><b>Priority: </b>3
</p>
<p><b>View other</b> <a href="https://cplusplus.github.io/LWG/lwg-index-open.html#range.join.iterator">active issues</a> in [range.join.iterator].</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#range.join.iterator">issues</a> in [range.join.iterator].</p>
<p><b>Discussion:</b></p>
<p>
<tt>join_view::<i>iterator</i></tt> has exposition-only members <tt><i>outer_</i></tt> &mdash; which holds an 
iterator into the adapted range &mdash; and <tt><i>inner_</i></tt> &mdash; which holds an iterator into the 
range denoted by <tt><i>outer_</i></tt>. After application of <a href="https://wg21.link/P2325R3">P2325R3</a> "Views should not be 
required to be default constructible" to the working draft, single-pass iterators can be 
<tt>non-default_initializable</tt>. P2325R3 constrains <tt>join_view::<i>iterator</i></tt>'s default constructor 
to require that the types of both <tt><i>outer_</i></tt> and <tt><i>inner_</i></tt> are <tt>default_initializable</tt>, 
indicating an intent to support such iterator types. However, the effect of the non-default constructor specified 
in 26.7.14.3 <a href="https://wg21.link/range.join.iterator">[range.join.iterator]</a> paragraph 6 is to default-initialize <tt><i>inner_</i></tt>, which is 
ill-formed if its type is not <tt>default_initializable</tt>.
</p>

<p><i>[2021-06-23; Reflector poll]</i></p>

<p>
Set priority to 3 after reflector poll.
</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p>
Wording relative to the <a href="https://github.com/cplusplus/draft/releases/download/n4892/n4892.pdf">post 2021-06 
virtual plenary working draft</a>. This PR is currently being implemented in MSVC.
</p>

<ol>
<li><p>Modify 26.7.14.3 <a href="https://wg21.link/range.join.iterator">[range.join.iterator]</a> as indicated:</p>

<blockquote>
<blockquote>
<pre>
namespace std::ranges {
  template&lt;input_range V&gt;
    requires view&lt;V&gt; &amp;&amp; input_range&lt;range_reference_t&lt;V&gt;&gt; &amp;&amp;
             (is_reference_v&lt;range_reference_t&lt;V&gt;&gt; ||
              view&lt;range_value_t&lt;V&gt;&gt;)
  template&lt;bool Const&gt;
  struct join_view&lt;V&gt;::<i>iterator</i> {
    [&hellip;]
    <ins>optional&lt;</ins><i>InnerIter</i><ins>&gt;</ins> <i>inner_</i><del> = <i>InnerIter</i>()</del>;
    [&hellip;]
    constexpr decltype(auto) operator*() const { return <ins>*</ins>*<i>inner_</i>; }
    [&hellip;]
    friend constexpr decltype(auto) iter_move(const <i>iterator</i>&amp; i)
    noexcept(noexcept(ranges::iter_move(<ins>*</ins>i.<i>inner_</i>))) {
      return ranges::iter_move(<ins>*</ins>i.<i>inner_</i>);
    }
    
    friend constexpr void iter_swap(const <i>iterator</i>&amp; x, const <i>iterator</i>&amp; y)
      noexcept(noexcept(ranges::iter_swap(<ins>*</ins>x.<i>inner_</i>, <ins>*</ins>y.<i>inner_</i>)))
      requires indirectly_swappable&lt;<i>InnerIter</i>&gt;;
  };
}
</pre>
</blockquote>
[&hellip;]
<pre>
constexpr void <i>satisfy();</i>       <i>// exposition only</i>
</pre>
<blockquote>
<p>
-5- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
auto update_inner = [this](const iterator_t&lt;<i>Base</i>&gt;&amp; x) -> auto&amp;&amp; {
[&hellip;] 
};
for (; <i>outer_</i> != ranges::end(<i>parent_</i>-&gt;<i>base_</i>); ++<i>outer_</i>) {
  auto&amp;&amp; inner = update_inner(*<i>outer_</i>);
  <i>inner_</i> = ranges::begin(inner);
  if (<ins>*</ins><i>inner_</i> != ranges::end(inner))
    return;
}
if constexpr (<i>ref-is-glvalue</i>)
  <i>inner_</i><ins>.reset()</ins><del> = <i>InnerIter</i>()</del>;
</pre>
</blockquote>
</blockquote>
[&hellip;]
<pre>
constexpr <i>InnerIter</i> operator-&gt;() const
  requires <i>has-arrow</i>&lt;<i>InnerIter</i>&gt; &amp;&amp; copyable&lt;<i>InnerIter</i>&gt;;
</pre>
<blockquote>
<p>
-8- <i>Effects:</i> Equivalent to: <tt>return <ins>*</ins><i>inner_</i>;</tt>
</p>
</blockquote>
<pre>
constexpr <i>iterator</i>&amp; operator++();
</pre>
<blockquote>
<p>
-9- Let <i>inner-range</i> be:
</p><p>
[&hellip;]
</p><p>
-10- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
auto&amp;&amp; inner_rng = <i>inner-range</i>;
if (++<ins>*</ins><i>inner_</i> == ranges::end(inner_rng)) {
  ++<i>outer_</i>;
  <i>satisfy</i>();
}
return *this;
</pre>
</blockquote>
</blockquote>
[&hellip;]
<pre>
constexpr <i>iterator</i>&amp; operator--()
  requires <i>ref-is-glvalue</i> &amp;&amp; bidirectional_range&lt;<i>Base</i>&gt; &amp;&amp;
           bidirectional_range&lt;range_reference_t&lt;Base&gt;&gt; &amp;&amp;
           common_range&lt;range_reference_t&lt;Base&gt;&gt;;
</pre>
<blockquote>
<p>
-13- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
if (<i>outer_</i> == ranges::end(<i>parent_</i>-&gt;<i>base_</i>))
  <i>inner_</i> = ranges::end(*--<i>outer_</i>);
while (<ins>*</ins><i>inner_</i> == ranges::begin(*<i>outer_</i>))
  <ins>*</ins><i>inner_</i> = ranges::end(*--<i>outer_</i>);
--<ins>*</ins><i>inner_</i>;
return *this;
</pre>
</blockquote>
</blockquote>
[&hellip;]
<pre>
friend constexpr void iter_swap(const <i>iterator</i>&amp; x, const <i>iterator</i>&amp; y)
  noexcept(noexcept(ranges::iter_swap(<ins>*</ins>x.<i>inner_</i>, <ins>*</ins>y.<i>inner_</i>)))
  requires indirectly_swappable&lt;<i>InnerIter</i>&gt;;
</pre>
<blockquote>
<p>
-16- <i>Effects:</i> Equivalent to: return <tt>ranges::iter_swap(<ins>*</ins>x.<i>inner_</i>, <ins>*</ins>y.<i>inner_</i>);</tt>
</p>
</blockquote>
</blockquote>
</li>

</ol>
</blockquote>

<p><i>[2021-08-23; Louis Dionne comments and provides improved wording]</i></p>

<p>
I believe the currently proposed resolution is missing the removal of the <tt>default_initializable&lt;<i>InnerIter</i>&gt;</tt> 
constraint on <tt>join_view::<i>iterator</i></tt>'s default constructor in 26.7.14.3 <a href="https://wg21.link/range.join.iterator">[range.join.iterator]</a>. Indeed, 
after the currently-proposed resolution, <tt>join_view::<i>iterator</i></tt> reads like:
</p>
<blockquote><pre>
template&lt;input_range V&gt;
  requires [&hellip;]
struct join_view&lt;V&gt;::<i>iterator</i> {
private:
  optional&lt;<i>InnerIter</i>&gt; <i>inner_</i>; <i>// exposition only</i>
  [&hellip;]
public:
  <i>iterator</i>() requires default_initializable&lt;<i>OuterIter</i>&gt; &amp;&amp;
                      default_initializable&lt;<i>InnerIter</i>&gt; = default;
    [&hellip;]
};
</pre></blockquote>
<p>
I believe we should drop the <tt>default_initializable&lt;<i>InnerIter</i>&gt;</tt> constraint from the default constructor 
(that seems like an oversight unless I missed something):
</p>
<blockquote><pre>
template&lt;input_range V&gt;
  requires [&hellip;]
struct join_view&lt;V&gt;::<i>iterator</i> {
private:
  optional&lt;<i>InnerIter</i>&gt; <i>inner_</i>; <i>// exposition only</i>
  [&hellip;]
public:
  <i>iterator</i>() requires default_initializable&lt;<i>OuterIter</i>&gt; = default;
  [&hellip;]
};
</pre></blockquote>

<p><i>[Kona 2022-11-08; Accepted at joint LWG/SG9 session. Move to Immediate]</i></p>




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

<ol>
<li><p>Modify 26.7.14.3 <a href="https://wg21.link/range.join.iterator">[range.join.iterator]</a> as indicated:</p>

<blockquote>
<blockquote>
<pre>
namespace std::ranges {
  template&lt;input_range V&gt;
    requires view&lt;V&gt; &amp;&amp; input_range&lt;range_reference_t&lt;V&gt;&gt; &amp;&amp;
             (is_reference_v&lt;range_reference_t&lt;V&gt;&gt; ||
              view&lt;range_value_t&lt;V&gt;&gt;)
  template&lt;bool Const&gt;
  struct join_view&lt;V&gt;::<i>iterator</i> {
    [&hellip;]
    <ins>optional&lt;</ins><i>InnerIter</i><ins>&gt;</ins> <i>inner_</i><del> = <i>InnerIter</i>()</del>;
    [&hellip;]
    <i>iterator</i>() requires default_initializable&lt;<i>OuterIter</i>&gt; <del>&amp;&amp;
                        default_initializable&lt;<i>InnerIter</i>&gt;</del> = default;
    [&hellip;]
    constexpr decltype(auto) operator*() const { return <ins>*</ins>*<i>inner_</i>; }
    [&hellip;]
    friend constexpr decltype(auto) iter_move(const <i>iterator</i>&amp; i)
    noexcept(noexcept(ranges::iter_move(<ins>*</ins>i.<i>inner_</i>))) {
      return ranges::iter_move(<ins>*</ins>i.<i>inner_</i>);
    }
    
    friend constexpr void iter_swap(const <i>iterator</i>&amp; x, const <i>iterator</i>&amp; y)
      noexcept(noexcept(ranges::iter_swap(<ins>*</ins>x.<i>inner_</i>, <ins>*</ins>y.<i>inner_</i>)))
      requires indirectly_swappable&lt;<i>InnerIter</i>&gt;;
  };
}
</pre>
</blockquote>
[&hellip;]
<pre>
constexpr void <i>satisfy();</i>       <i>// exposition only</i>
</pre>
<blockquote>
<p>
-5- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
auto update_inner = [this](const iterator_t&lt;<i>Base</i>&gt;&amp; x) -> auto&amp;&amp; {
[&hellip;] 
};
for (; <i>outer_</i> != ranges::end(<i>parent_</i>-&gt;<i>base_</i>); ++<i>outer_</i>) {
  auto&amp;&amp; inner = update_inner(*<i>outer_</i>);
  <i>inner_</i> = ranges::begin(inner);
  if (<ins>*</ins><i>inner_</i> != ranges::end(inner))
    return;
}
if constexpr (<i>ref-is-glvalue</i>)
  <i>inner_</i><ins>.reset()</ins><del> = <i>InnerIter</i>()</del>;
</pre>
</blockquote>
</blockquote>
[&hellip;]
<pre>
constexpr <i>InnerIter</i> operator-&gt;() const
  requires <i>has-arrow</i>&lt;<i>InnerIter</i>&gt; &amp;&amp; copyable&lt;<i>InnerIter</i>&gt;;
</pre>
<blockquote>
<p>
-8- <i>Effects:</i> Equivalent to: <tt>return <ins>*</ins><i>inner_</i>;</tt>
</p>
</blockquote>
<pre>
constexpr <i>iterator</i>&amp; operator++();
</pre>
<blockquote>
<p>
-9- Let <i>inner-range</i> be:
</p><p>
[&hellip;]
</p><p>
-10- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
auto&amp;&amp; inner_rng = <i>inner-range</i>;
if (++<ins>*</ins><i>inner_</i> == ranges::end(inner_rng)) {
  ++<i>outer_</i>;
  <i>satisfy</i>();
}
return *this;
</pre>
</blockquote>
</blockquote>
[&hellip;]
<pre>
constexpr <i>iterator</i>&amp; operator--()
  requires <i>ref-is-glvalue</i> &amp;&amp; bidirectional_range&lt;<i>Base</i>&gt; &amp;&amp;
           bidirectional_range&lt;range_reference_t&lt;Base&gt;&gt; &amp;&amp;
           common_range&lt;range_reference_t&lt;Base&gt;&gt;;
</pre>
<blockquote>
<p>
-13- <i>Effects:</i> Equivalent to:
</p>
<blockquote>
<pre>
if (<i>outer_</i> == ranges::end(<i>parent_</i>-&gt;<i>base_</i>))
  <i>inner_</i> = ranges::end(*--<i>outer_</i>);
while (<ins>*</ins><i>inner_</i> == ranges::begin(*<i>outer_</i>))
  <ins>*</ins><i>inner_</i> = ranges::end(*--<i>outer_</i>);
--<ins>*</ins><i>inner_</i>;
return *this;
</pre>
</blockquote>
</blockquote>
[&hellip;]
<pre>
friend constexpr void iter_swap(const <i>iterator</i>&amp; x, const <i>iterator</i>&amp; y)
  noexcept(noexcept(ranges::iter_swap(<ins>*</ins>x.<i>inner_</i>, <ins>*</ins>y.<i>inner_</i>)))
  requires indirectly_swappable&lt;<i>InnerIter</i>&gt;;
</pre>
<blockquote>
<p>
-16- <i>Effects:</i> Equivalent to: return <tt>ranges::iter_swap(<ins>*</ins>x.<i>inner_</i>, <ins>*</ins>y.<i>inner_</i>);</tt>
</p>
</blockquote>
</blockquote>
</li>

</ol>




<hr>
<h3><a name="3717" href="https://cplusplus.github.io/LWG/lwg-active.html#3717">3717</a>. <tt>common_view::end</tt> should improve <tt>random_access_range</tt> case</h3>
<p><b>Section:</b> 26.7.19.2 <a href="https://wg21.link/range.common.view">[range.common.view]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Hewill Kang <b>Opened:</b> 2022-06-15 <b>Last modified:</b> 2022-11-11</p>
<p><b>Priority: </b>3
</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#range.common.view">issues</a> in [range.common.view].</p>
<p><b>Discussion:</b></p>

<p>
This issue is part of NB comment <b><a href="https://github.com/cplusplus/nbballot/issues/524">US 47-109</a></b>
26 [ranges] Resolve open issues
</p>

<p>
In view of the fact that random access iterators are only required to work with its difference type, 
<a href="https://wg21.link/P2393R1">P2393R1</a> improves the wording of <tt>take_view</tt>, which first convert the integer type 
to difference type and then operate with the iterator. However, the paper omits the handling of random 
access iterators in <tt>common_view::end</tt>, which directly operates on the return types of 
<tt>ranges::begin</tt> and <tt>ranges::size</tt>. We should improve this, too.
</p>

<p><i>[2022-07-06; Reflector poll]</i></p>

<p>
Set priority to 3 after reflector poll.
</p>

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

<ol>
<li><p>Modify 26.7.19.2 <a href="https://wg21.link/range.common.view">[range.common.view]</a> as indicated:</p>

<blockquote>
<pre>
namespace std::ranges {
  template&lt;view V&gt;
    requires (!common_range&lt;V&gt; &amp;&amp; copyable&lt;iterator_t&lt;V&gt;&gt;)
  class common_view : public view_interface&lt;common_view&lt;V&gt;&gt; {
  private:
    V <i>base_</i> = V();  <i>// exposition only</i>
  public:
    [&hellip;]
    constexpr auto begin() {
      if constexpr (random_access_range&lt;V&gt; &amp;&amp; sized_range&lt;V&gt;)
        return ranges::begin(<i>base_</i>);
      else
        return common_iterator&lt;iterator_t&lt;V&gt;, sentinel_t&lt;V&gt;&gt;(ranges::begin(<i>base_</i>));
    }

    constexpr auto begin() const requires range&lt;const V&gt; {
      if constexpr (random_access_range&lt;const V&gt; &amp;&amp; sized_range&lt;const V&gt;)
        return ranges::begin(<i>base_</i>);
      else
        return common_iterator&lt;iterator_t&lt;const V&gt;, sentinel_t&lt;const V&gt;&gt;(ranges::begin(<i>base_</i>));
    }
    
    constexpr auto end() {
      if constexpr (random_access_range&lt;V&gt; &amp;&amp; sized_range&lt;V&gt;)
        return ranges::begin(<i>base_</i>) + <ins>range_difference_t&lt;V&gt;(size())</ins><del>ranges::size(<i>base_</i>)</del>;
      else
        return common_iterator&lt;iterator_t&lt;V&gt;, sentinel_t&lt;V&gt;&gt;(ranges::end(<i>base_</i>));
    }

    constexpr auto end() const requires range&lt;const V&gt; {
      if constexpr (random_access_range&lt;const V&gt; &amp;&amp; sized_range&lt;const V&gt;)
        return ranges::begin(<i>base_</i>) + <ins>range_difference_t&lt;const V&gt;(size())</ins><del>ranges::size(<i>base_</i>)</del>;
      else
        return common_iterator&lt;iterator_t&lt;const V&gt;, sentinel_t&lt;const V&gt;&gt;(ranges::end(<i>base_</i>));
    }

    constexpr auto size() requires sized_range&lt;V&gt; {
      return ranges::size(<i>base_</i>);
    }
    constexpr auto size() const requires sized_range&lt;const V&gt; {
      return ranges::size(<i>base_</i>);
    }
  };
  [&hellip;]
}
</pre>
</blockquote>
</li>

</ol>
</blockquote>

<p><i>[Kona 2022-11-08; Discussed at joint LWG/SG9 session. Move to Open]</i></p>

<p><i>[2022-11-09 Tim updates wording per LWG discussion]</i></p>

<p><i>[Kona 2022-11-10; Move to Immediate]</i></p>




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

<ol>
<li><p>Modify 26.7.19.2 <a href="https://wg21.link/range.common.view">[range.common.view]</a> as indicated:</p>

<blockquote>
<pre>
namespace std::ranges {
  template&lt;view V&gt;
    requires (!common_range&lt;V&gt; &amp;&amp; copyable&lt;iterator_t&lt;V&gt;&gt;)
  class common_view : public view_interface&lt;common_view&lt;V&gt;&gt; {
  private:
    V <i>base_</i> = V();  <i>// exposition only</i>
  public:
    [&hellip;]
    constexpr auto begin() {
      if constexpr (random_access_range&lt;V&gt; &amp;&amp; sized_range&lt;V&gt;)
        return ranges::begin(<i>base_</i>);
      else
        return common_iterator&lt;iterator_t&lt;V&gt;, sentinel_t&lt;V&gt;&gt;(ranges::begin(<i>base_</i>));
    }

    constexpr auto begin() const requires range&lt;const V&gt; {
      if constexpr (random_access_range&lt;const V&gt; &amp;&amp; sized_range&lt;const V&gt;)
        return ranges::begin(<i>base_</i>);
      else
        return common_iterator&lt;iterator_t&lt;const V&gt;, sentinel_t&lt;const V&gt;&gt;(ranges::begin(<i>base_</i>));
    }
    
    constexpr auto end() {
      if constexpr (random_access_range&lt;V&gt; &amp;&amp; sized_range&lt;V&gt;)
        return ranges::begin(<i>base_</i>) + ranges::<del>size</del><ins>distance</ins>(<i>base_</i>);
      else
        return common_iterator&lt;iterator_t&lt;V&gt;, sentinel_t&lt;V&gt;&gt;(ranges::end(<i>base_</i>));
    }

    constexpr auto end() const requires range&lt;const V&gt; {
      if constexpr (random_access_range&lt;const V&gt; &amp;&amp; sized_range&lt;const V&gt;)
        return ranges::begin(<i>base_</i>) + ranges::<del>size</del><ins>distance</ins>(<i>base_</i>);
      else
        return common_iterator&lt;iterator_t&lt;const V&gt;, sentinel_t&lt;const V&gt;&gt;(ranges::end(<i>base_</i>));
    }

    constexpr auto size() requires sized_range&lt;V&gt; {
      return ranges::size(<i>base_</i>);
    }
    constexpr auto size() const requires sized_range&lt;const V&gt; {
      return ranges::size(<i>base_</i>);
    }
  };
  [&hellip;]
}
</pre>
</blockquote>
</li>

</ol>





<hr>
<h3><a name="3737" href="https://cplusplus.github.io/LWG/lwg-active.html#3737">3737</a>. <tt>take_view::<i>sentinel</i></tt> should provide <tt>operator-</tt></h3>
<p><b>Section:</b> 26.7.10.3 <a href="https://wg21.link/range.take.sentinel">[range.take.sentinel]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Hewill Kang <b>Opened:</b> 2022-07-15 <b>Last modified:</b> 2022-11-11</p>
<p><b>Priority: </b>3
</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#range.take.sentinel">issues</a> in [range.take.sentinel].</p>
<p><b>Discussion:</b></p>

<p>
This issue is part of NB comment <b><a href="https://github.com/cplusplus/nbballot/issues/524">US 47-109</a></b>
26 [ranges] Resolve open issues
</p>

<p>
When the underlying range is not a <tt>sized_range</tt>, the <tt>begin</tt> and <tt>end</tt> functions 
of <tt>take_view</tt> return <tt>counted_iterator</tt> and <tt>take_view::<i>sentinel</i></tt> respectively. 
However, the sentinel type of the underlying range may still model <tt>sized_sentinel_for</tt> for its 
iterator type, and since <tt>take_view::<i>sentinel</i></tt> can only be compared to <tt>counted_iterator</tt>, 
this makes <tt>take_view</tt> no longer able to compute the distance between its iterator and sentinel.
</p><p>
We are needlessly losing functionality here. Since calculating the distance, in this case, is still simple, 
i.e. we just need to compute the minimum of <tt>counted_iterator::count</tt> and the difference between 
the underlying iterator and sentinel, I think providing <tt>operator-</tt> for 
<tt>take_view::<i>sentinel</i></tt> does bring some value.
</p>

<p><i>[2022-08-23; Reflector poll]</i></p>

<p>
Set priority to 3 after reflector poll.
</p>
<p>
Some P0 votes, but with objections:
"This seems like a) a feature not a bug - of fairly limited utility?,
and b) I’d like to see an implementation (maybe it’s in MSVC?)
to be sure there isn’t a negative interaction we’re not thinking of."
</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">

<p>
This wording is relative to <a href="https://wg21.link/N4910">N4910</a>.
</p>

<ol>

<li><p>Modify 26.7.10.3 <a href="https://wg21.link/range.take.sentinel">[range.take.sentinel]</a>, class template <tt>take_view::<i>sentinel</i></tt> synopsis, 
as indicated:</p>

<blockquote>
<blockquote>
<pre>
namespace std::ranges {
  template&lt;view V&gt;
  template&lt;bool Const&gt;
  class take_view&lt;V&gt;::<i>sentinel</i> {
  private:
    using <i>Base</i> = <i>maybe-const</i>&lt;Const, V&gt;;                                     <i>// exposition only</i>
    template&lt;bool OtherConst&gt;
      using <i>CI</i> = counted_iterator&lt;iterator_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;&gt;;  <i>// exposition only</i>
    sentinel_t&lt;<i>Base</i>&gt; <i>end_</i> = sentinel_t&lt;<i>Base</i>&gt;();                             <i>// exposition only</i>
  public:
    [&hellip;]
    friend constexpr bool operator==(const <i>CI</i>&lt;Const&gt;&amp; y, const <i>sentinel</i>&amp; x);

    template&lt;bool OtherConst = !Const&gt;
      requires sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;&gt;
    friend constexpr bool operator==(const <i>CI</i>&lt;OtherConst&gt;&amp; y, const <i>sentinel</i>&amp; x);
    <ins>
    friend constexpr range_difference_t&lt;<i>Base</i>&gt;
      operator-(const <i>sentinel</i>&amp; x, const <i>CI</i>&lt;Const&gt;&amp; y)
        requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>Base</i>&gt;&gt;;

    template&lt;bool OtherConst = !Const&gt;
      requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;&gt;
    friend constexpr range_difference_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;
      operator-(const <i>sentinel</i>&amp; x, const <i>CI</i>&lt;OtherConst&gt;&amp; y);

    friend constexpr range_difference_t&lt;<i>Base</i>&gt;
      operator-(const <i>CI</i>&lt;Const&gt;&amp; x, const <i>sentinel</i>&amp; y)
        requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>Base</i>&gt;&gt;;

    template&lt;bool OtherConst = !Const&gt;
      requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;&gt;
    friend constexpr range_difference_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;
      operator-(const <i>CI</i>&lt;OtherConst&gt;&amp; x, const <i>sentinel</i>&amp; y);</ins>
  };
}
</pre>
</blockquote>
[&hellip;]
<pre>
friend constexpr bool operator==(const <i>CI</i>&lt;Const&gt;&amp; y, const <i>sentinel</i>&amp; x);

template&lt;bool OtherConst = !Const&gt;
  requires sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;&gt;
friend constexpr bool operator==(const <i>CI</i>&lt;OtherConst&gt;&amp; y, const <i>sentinel</i>&amp; x);
</pre>
<blockquote>
<p>
-4- <i>Effects:</i> Equivalent to: <tt>return y.count() == 0 || y.base() == x.<i>end_</i>;</tt>
</p>
</blockquote>
<pre>
<ins>
friend constexpr range_difference_t&lt;<i>Base</i>&gt; 
  operator-(const <i>sentinel</i>&amp; x, const <i>CI</i>&lt;Const&gt;&amp; y)
    requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>Base</i>&gt;&gt;; 

template&lt;bool OtherConst = !Const&gt;
  requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;&gt;
friend constexpr range_difference_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;
  operator-(const <i>sentinel</i>&amp; x, const <i>CI</i>&lt;OtherConst&gt;&amp; y);</ins>
</pre>
<blockquote>
<p>
<ins>-?- <i>Effects:</i> Equivalent to: <tt>return ranges::min(y.count(), x.<i>end_</i> - y.base());</tt></ins>
</p>
</blockquote>
<pre>
<ins>
friend constexpr range_difference_t&lt;<i>Base</i>&gt;
  operator-(const <i>CI</i>&lt;Const&gt;&amp; x, const <i>sentinel</i>&amp; y)
    requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>Base</i>&gt;&gt;;

template&lt;bool OtherConst = !Const&gt;
  requires sized_sentinel_for&lt;sentinel_t&lt;<i>Base</i>&gt;, iterator_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;&gt;
friend constexpr range_difference_t&lt;<i>maybe-const</i>&lt;OtherConst, V&gt;&gt;
  operator-(const <i>CI</i>&lt;OtherConst&gt;&amp; x, const <i>sentinel</i>&amp; y);
</ins>
</pre>
<blockquote>
<p>
<ins>-?- <i>Effects:</i> Equivalent to: <tt>return -(y - x);</tt></ins>
</p>
</blockquote>
</blockquote>
</li>
</ol>
</blockquote>
<p><i>[Kona 2022-11-08; Discussed at joint LWG/SG9 session. Move to Open]</i></p>

<p><i>[2022-11-09 Tim updates wording following LWG discussion]</i></p>

<p>
This case is only possible if the source view is not a <tt>sized_range</tt>, yet its 
iterator/sentinel types model <tt>sized_sentinel_for</tt> (typically when source
is an input range). In such a case we should just have <tt>begin</tt> compute
the correct size so that <tt>end</tt> can just return <tt>default_sentinel</tt>.
</p>

<p><i>[Kona 2022-11-10; Move to Immediate]</i></p>



<p id="res-3737"><b>Proposed resolution:</b></p>
<p>
This wording is relative to <a href="https://wg21.link/N4917">N4917</a>.
</p>
<ol>
<li><p>Modify 26.7.10.2 <a href="https://wg21.link/range.take.view">[range.take.view]</a>, class template <tt>take_view</tt> synopsis, as indicated:</p>

<blockquote>
<pre>
namespace std::ranges {
  template&lt;view V&gt;
  class take_view : public view_interface&lt;take_view&lt;V&gt;&gt; {
  private:
    [&hellip;]
  public:
    [&hellip;]
    constexpr auto begin() requires (!<i>simple-view</i>&lt;V&gt;) {
      if constexpr (sized_range&lt;V&gt;) {
        if constexpr (random_access_range&lt;V&gt;) {
          return ranges::begin(<i>base_</i>);
        } else {
          auto sz = range_difference_t&lt;V&gt;(size());
          return counted_iterator(ranges::begin(<i>base_</i>), sz);
        }
      }<ins> else if constexpr (sized_sentinel_for&lt;sentinel_t&lt;V&gt;, iterator_t&lt;V&gt;&gt;) {
        auto it = ranges::begin(<i>base_</i>);
        auto sz = std::min(<i>count_</i>, ranges::end(<i>base_</i>) - it);
        return counted_iterator(std::move(it), sz);
      }</ins> else {
        return counted_iterator(ranges::begin(<i>base_</i>), <i>count_</i>);
      }
    }

    constexpr auto begin() const requires range&lt;const V&gt; {
      if constexpr (sized_range&lt;const V&gt;) {
        if constexpr (random_access_range&lt;const V&gt;) {
          return ranges::begin(<i>base_</i>);
        } else {
          auto sz = range_difference_t&lt;const V&gt;(size());
          return counted_iterator(ranges::begin(<i>base_</i>), sz);
        }
      }<ins> else if constexpr (sized_sentinel_for&lt;sentinel_t&lt;const V&gt;, iterator_t&lt;const V&gt;&gt;) {
        auto it = ranges::begin(<i>base_</i>);
        auto sz = std::min(<i>count_</i>, ranges::end(<i>base_</i>) - it);
        return counted_iterator(std::move(it), sz);
      }</ins> else {
        return counted_iterator(ranges::begin(<i>base_</i>), <i>count_</i>);
      }
    }

    constexpr auto end() requires (!<i>simple-view</i>&lt;V&gt;) {
      if constexpr (sized_range&lt;V&gt;) {
        if constexpr (random_access_range&lt;V&gt;)
          return ranges::begin(<i>base_</i>) + range_difference_t&lt;V&gt;(size());
        else
          return default_sentinel;
      }<ins> else if constexpr (sized_sentinel_for&lt;sentinel_t&lt;V&gt;, iterator_t&lt;V&gt;&gt;) {
        return default_sentinel;
      }</ins> else {
        return sentinel&lt;false&gt;{ranges::end(<i>base_</i>)};
      }
    }

    constexpr auto end() const requires range&lt;const V&gt; {
      if constexpr (sized_range&lt;const V&gt;) {
        if constexpr (random_access_range&lt;const V&gt;)
          return ranges::begin(<i>base_</i>) + range_difference_t&lt;const V&gt;(size());
        else
          return default_sentinel;
      }<ins> else if constexpr (sized_sentinel_for&lt;sentinel_t&lt;const V&gt;, iterator_t&lt;const V&gt;&gt;) {
        return default_sentinel;
      }</ins> else {
        return sentinel&lt;true&gt;{ranges::end(<i>base_</i>)};
      }
    }
    
    [&hellip;]
  };
  [&hellip;]
}
</pre>
</blockquote>
</li>
</ol>





<hr>
<h3><a name="3753" href="https://cplusplus.github.io/LWG/lwg-active.html#3753">3753</a>. Clarify entity vs. freestanding entity</h3>
<p><b>Section:</b> 16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Ben Craig <b>Opened:</b> 2022-08-23 <b>Last modified:</b> 2022-11-11</p>
<p><b>Priority: </b>2
</p>
<p><b>View other</b> <a href="https://cplusplus.github.io/LWG/lwg-index-open.html#freestanding.entity">active issues</a> in [freestanding.entity].</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#freestanding.entity">issues</a> in [freestanding.entity].</p>
<p><b>Discussion:</b></p>
<p>
This addresses NB comment
<b><a href="https://github.com/cplusplus/nbballot/issues/448">GB-075</a></b>
( [freeestanding.entity] "Freestanding entities" are not entities)
</p>

<p>
16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> p1 defines a freestanding entity as
a declaration or macro definition.
</p>

<p>
16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> p3 then says
"entities followed with a comment [&hellip;] are freestanding entities".
</p>

<p>
This is inconsistent, and breaks with macros,
because macros are not entities, but they can be freestanding entities.
</p>

<p><i>[2022-09-23; Reflector poll]</i></p>

<p>
Set priority to 2 after reflector poll.
</p>
<p>
It's confusing for "freestanding entities" to be two things, neither of which are entities. Declarations may declare entities, they are not entities themselves. Given this definition, p6/7/8 makes no sense. A namespace can't be a freestanding entity since it's neither a declaration nor a macro definition.
</p>
<p>
"freestanding entities" is not best name, given the collision with core entity, but I think that this is separable issue.
</p>


<p><i>[2022-09-28; Reflector poll]</i></p>

<p>
Set status to Tentatively Ready after five votes in favour during reflector poll.
</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p> This wording is relative to the forthcoming C++23 CD. </p>

<ul>
<li>
<p>
Modify 16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> as indicated:
</p>

<blockquote>
-3- In a header synopsis,
<del>entities</del>
<ins>declarations and macro definitions</ins>
followed with a comment that includes <i>freestanding</i>
are freestanding entities.
</blockquote>
</li>
</ul>
</blockquote>

<p><i>[2022-11-06; Ben Craig provides new wording]</i></p>


<p><i>[2022-11-07; Kona - move to open]</i></p>

<p>New proposed resolution to be added.  </p>

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

<ol>
<li><p>Modify 16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
</p>
</blockquote>

<blockquote>
<p>
<b>16.3.3.6 Freestanding <del>entities</del><ins>items</ins> [freestanding.<ins>item</ins><del>entity</del>]</b>
</p><p>
-1- A <i>freestanding <del>entity</del><ins>item</ins></i> is <del>a declaration</del><ins>an entity</ins> or 
macro definition that is present in a freestanding implementation and a hosted implementation.
</p><p>
-2- Unless otherwise specified, the requirements on freestanding <del>entities</del><ins>items</ins> on a 
freestanding implementation are the same as the corresponding requirements in a hosted implementation.
</p><p>
-3- In a header synopsis, entities <ins>introduced by declarations</ins> followed with a comment that includes 
<i>freestanding</i> are freestanding <del>entities</del><ins>items</ins>.
</p><p>
<ins>-?- In a header synopsis, macro definitions followed with a comment that includes <i>freestanding</i> are 
freestanding items.</ins>
</p><p>
[&hellip;]
</p><p>
-4- If a header synopsis begins with a comment that includes <i>all freestanding</i>, then all of the 
<ins>entities introduced by</ins> declarations <del>and macro definitions</del> in the header synopsis are 
freestanding <del>entities</del><ins>items</ins>.
</p><p>
<ins>-?- If a header synopsis begins with a comment that includes <i>all freestanding</i>, then all of the 
macro definitions in the header synopsis are freestanding items.</ins>
</p><p>
[&hellip;]
</p><p>
-5- Deduction guides for freestanding <del>entity</del><ins>item</ins> class templates are freestanding 
<del>entities</del><ins>items</ins>.
</p><p>
-6- Enclosing namespaces of freestanding  <del>entities</del><ins>items</ins> are freestanding <del>entities</del><ins>items</ins>.
</p><p>
-7- Friends of freestanding <del>entities</del><ins>items</ins> are freestanding <del>entities</del><ins>items</ins>.
</p><p>
-8- Entities denoted by freestanding  <del>entity</del><ins>item</ins> <i>typedef-name</i>s and freestanding 
 <del>entity</del><ins>item</ins> alias templates are freestanding <del>entities</del><ins>items</ins>.
</p>
</blockquote>
</li>

<li><p>Modify 16.4.2.5 <a href="https://wg21.link/compliance">[compliance]</a> as indicated:</p>

<blockquote>
<p>
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
<del>entities</del><ins>items</ins> (16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a>) declared in the header.
</p>
</blockquote>
</li>

<li><p>Modify 22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> as indicated:</p>

<blockquote>
<p>
-3- Placeholders are freestanding <del>entities</del><ins>items</ins> (16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a>).
</p>
</blockquote>
</li>
</ol>

</blockquote>

<p><i>[2022-11-08; Ben Craig provides improved wording]</i></p>

<p>This combined resolution addresses both 3753 and LWG <a href="https://cplusplus.github.io/LWG/lwg-active.html#3815">3815</a>,
and has already been reviewed by LWG.</p>

<p>
This resolves ballot comment GB-75.
It also partially addresses GB-130 (along with LWG <a href="https://cplusplus.github.io/LWG/lwg-active.html#3814">3814</a>).
</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">

<p>
This wording is relative to <a href="https://wg21.link/N4917">N4917</a>.
</p>

<ol>
<li><p>Modify 16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
</p>
</blockquote>

<blockquote>
<p>
<b>16.3.3.6 Freestanding <del>entities</del><ins>items</ins> [freestanding.<ins>item</ins><del>entity</del>]</b>
</p><p>
-1- A <i>freestanding <del>entity</del><ins>item</ins></i> is <del>a declaration</del><ins>an entity</ins> or
macro definition that is present in a freestanding implementation and a hosted implementation.
</p><p>
-2- Unless otherwise specified, the requirements on <ins>non-namespace </ins>freestanding <del>entities</del><ins>items</ins> on a freestanding implementation are the same as the corresponding requirements in a hosted implementation.
</p><p>
<ins>[<i>Note</i>: Enumerators impose requirements on their enumerations. Freestanding item enumerations have the same enumerators on freestanding implementations and hosted implementations. Members and deduction guides impose requirements on their class types. Class types have the same deduction guides and members on freestanding implementations and hosted implementations. — <i>end note</i>]</ins>
</p><p>
-3- In a header synopsis, <del>entities </del><ins>each entity introduced by a declaration</ins> followed <del>with</del><ins>by</ins> a comment that includes
<i>freestanding</i> <del>are</del><ins>is a</ins> freestanding <del>entities</del><ins>item</ins>.
</p><p>
<ins>-?- In a header synopsis, each macro definition followed by a comment that includes <i>freestanding</i> is a
freestanding item.</ins>
</p><p>
[&hellip;]
</p><p>
-4- If a header synopsis begins with a comment that includes <i>all freestanding</i>, then <del>all of the
 declarations and macro definitions</del><ins>each entity introduced by a declaration</ins> in the header synopsis <del>are</del><ins>is a</ins>
freestanding <del>entities</del><ins>item</ins>.
</p><p>
<ins>-?- If a header synopsis begins with a comment that includes <i>all freestanding</i>, then each
macro definition in the header synopsis is a freestanding item.</ins>
</p><p>
[&hellip;]
</p><p>
<del>-5- Deduction guides for freestanding entity class templates are freestanding
entities.</del>
</p><p>
-6- <del>Enclosing namespaces of freestanding entities are freestanding entities.</del>
<ins>Each enclosing namespace of each freestanding item is a freestanding item.</ins>
</p><p>
-7- <del>Friends of freestanding entities are freestanding entities.</del>
<ins>Each friend of each freestanding item is a freestanding item.</ins>
</p><p>
-8- <del>Entities denoted by freestanding entity <i>typedef-name</i>s and freestanding entity alias templates are freestanding entities.</del>
<ins>Each entity denoted by each freestanding item <i>typedef-name</i> and each freestanding item alias template is a freestanding item.</ins>
</p>
</blockquote>
</li>

<li><p>Modify 16.4.2.5 <a href="https://wg21.link/compliance">[compliance]</a> as indicated:</p>

<blockquote>
<p>
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
<del>entities</del><ins>items</ins> (16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.<del>entity</del><ins>item</ins>]</a>) declared in the header.
</p>
</blockquote>
</li>

<li><p>Modify 22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> as indicated:</p>

<blockquote>
<p>
-3- Placeholders are freestanding <del>entities</del><ins>items</ins> (16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.<del>entity</del><ins>item</ins>]</a>).
</p>
</blockquote>
</li>
</ol>

</blockquote>

<p><i>[2022-11-09; Ben Craig and Tomasz provide improved wording]</i></p>

<p>
This new resolution merges definition of freestanding item for entity in macro into bullet lists.
It still addresses both 3753 and LWG <a href="https://cplusplus.github.io/LWG/lwg-active.html#3815">3815</a>.
</p>

<p>
This resolves ballot comment GB-75.
It also partially addresses GB-130 (along with LWG <a href="https://cplusplus.github.io/LWG/lwg-active.html#3814">3814</a>).
</p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">

<p>
This wording is relative to <a href="https://wg21.link/N4917">N4917</a>.
</p>

<ol>
<li><p>Modify 16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
</p>
</blockquote>

<blockquote>
<p>
<b>16.3.3.6 Freestanding <del>entities</del><ins>items</ins> [freestanding.<ins>item</ins><del>entity</del>]</b>
</p><p>
-1- A <i>freestanding <del>entity</del><ins>item</ins></i> is <del>a declaration</del><ins>an entity</ins> or
macro definition that is present in a freestanding implementation and a hosted implementation.
</p><p>
-2- Unless otherwise specified, the requirements on freestanding <del>entities</del><ins>items, except namespaces,</ins> 
<del>on</del><ins>for</ins> a freestanding implementation are the same as the corresponding requirements <del>in</del><ins>for</ins> 
a hosted implementation.
</p><p>
<ins>[<i>Note</i>: This implies that freestanding item enumerations have the same enumerators on freestanding implementations 
and hosted implementations. Furthermore, class types have the same deduction guides and members on freestanding implementations 
and hosted implementations. &mdash; <i>end note</i>]</ins>
</p><p>
<ins>-3- An entity is a freestanding item, if it is:</ins>
<ol style="list-style-type: none">
<li><p><ins>(3.1) &mdash; introduced by a declaration in the header synopsis, and</ins></p>
<ol style="list-style-type: none">
<li><p><ins>(3.1.1) &mdash; the declaration is followed by a comment that includes <i>freestanding</i>, or</ins></p></li>
<li><p><ins>(3.1.2) &mdash; the header synopsis begins with a comment that includes <i>all freestanding</i>;</ins></p></li>
</ol></li>
<li><p><ins>(3.2) &mdash; an enclosing namespace of a freestanding item,</ins></p></li>
<li><p><ins>(3.3) &mdash; a friend of a freestanding item,</ins></p></li>
<li><p><ins>(3.4) &mdash; denoted by a <i>typedef-name</i>, that is a freestanding item, or</ins></p></li>
<li><p><ins>(3.5) &mdash; denoted by a template alias, that is a freestanding item.</ins></p></li>
</ol>
<p>
<ins>-4- A macro definition is a freestanding item, if it is defined in the header synopsis and</ins>
<ol style="list-style-type: none">
<li><p><ins>(4.1) &mdash; the definition is followed by a comment that includes <i>freestanding</i> in the header synopsis, or</ins></p></li>
<li><p><ins>(4.2) &mdash; the header synopsis begins with a comment that includes <i>all freestanding.</i></ins></p></li>
</ol>
<p>
<del>-3- In a header synopsis, entities followed with a comment that includes <i>freestanding</i> are freestanding entities.</del>
</p><p>
[<i>Example 1</i>: &hellip; &mdash; <i>end example</i>]
</p><p>
<del>-4- If a header synopsis begins with a comment that includes <i>all freestanding</i>,
 then all of the declarations and macro definitions in the header synopsis are freestanding entities..</del>
</p><p>
[<i>Example 2</i>: &hellip; &mdash; <i>end example</i>]
</p><p>
<del>-5- Deduction guides for freestanding entity class templates are freestanding
entities.</del>
</p><p>
<del>-6- Enclosing namespaces of freestanding entities are freestanding entities.</del>
</p><p>
<del>-7- Friends of freestanding entities are freestanding entities.</del>
</p><p>
<del>-8- Entities denoted by freestanding entity <i>typedef-name</i>s and freestanding entity alias templates are freestanding entities.</del>
</p>
</blockquote>
</li>

<li><p>Modify 16.4.2.5 <a href="https://wg21.link/compliance">[compliance]</a> as indicated:</p>

<blockquote>
<p>
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
<del>entities</del><ins>items</ins> (16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.<del>entity</del><ins>item</ins>]</a>) 
declared in the header.
</p>
</blockquote>
</li>

<li><p>Modify 22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> as indicated:</p>

<blockquote>
<p>
-3- Placeholders are freestanding <del>entities</del><ins>items</ins> 
(16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.<del>entity</del><ins>item</ins>]</a>).
</p>
</blockquote>
</li>
</ol>

</blockquote>

<p><i>[2022-11-10; Tomasz provide improved wording]</i></p>

<p>
Updated wording to support freestanding <i>typedef-name</i>s and using declaration that are not entities.
It still addresses both 3753 and LWG <a href="https://cplusplus.github.io/LWG/lwg-active.html#3815">3815</a>.
</p>

<p>
This resolves ballot comment GB-75.
It also partially addresses GB-130 (along with LWG <a href="https://cplusplus.github.io/LWG/lwg-active.html#3814">3814</a>).
</p>

<p><i>[Kona 2022-11-10; Move to Immediate]</i></p>





<p id="res-3753"><b>Proposed resolution:</b></p>

<p>
This wording is relative to <a href="https://wg21.link/N4917">N4917</a>.
</p>

<ol>
<li><p>Modify 16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.entity]</a> as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> Replace the section name [freestanding.entity] by [freestanding.item] throughout the working draft]
</p>
</blockquote>

<blockquote>
<p>
<b>16.3.3.6 Freestanding <del>entities</del><ins>items</ins> [freestanding.<ins>item</ins><del>entity</del>]</b>
</p><p>
-1- A <i>freestanding <del>entity</del><ins>item</ins></i> is a declaration<ins>, entity, <i>typedef-name</i>, </ins> or
macro <del>definition</del> that is <ins>required to be</ins> present in a freestanding implementation and a hosted implementation.
</p><p>
-2- Unless otherwise specified, the requirements on freestanding <del>entities</del><ins>items</ins> 
<del>on</del><ins>for</ins> a freestanding implementation are the same as the corresponding requirements <del>in</del><ins>for</ins> 
a hosted implementation<ins>, except that not all of the members of the namespaces are required to be present</ins>.
</p><p>
<ins>[<i>Note</i>: This implies that freestanding item enumerations have the same enumerators on freestanding implementations 
and hosted implementations. Furthermore, class types have the same members and class templates have the same deduction guides
on freestanding implementations and hosted implementations. &mdash; <i>end note</i>]</ins>
</p><p>
<ins>-3- A declaration in a header synopsis is a freestanding item if</ins>
<ol style="list-style-type: none">
<li><p><ins>(3.1) &mdash; it is followed by a comment that includes <i>freestanding</i>, or</ins></p></li>
<li><p><ins>(3.1) &mdash; the header synopsis begins with a comment that includes <i>all freestanding</i>.</ins></p></li>
</ol>
<p>
<ins>-4- An entity or <i>typedef-name</i> is a freestanding item if it is:</ins>
<ol style="list-style-type: none">
<li><p><ins>(4.1) &mdash; introduced by a declaration that is a freestanding item,</ins></p></li>
<li><p><ins>(4.2) &mdash; an enclosing namespace of a freestanding item,</ins></p></li>
<li><p><ins>(4.3) &mdash; a friend of a freestanding item,</ins></p></li>
<li><p><ins>(4.4) &mdash; denoted by a <i>typedef-name</i> that is a freestanding item, or</ins></p></li>
<li><p><ins>(4.5) &mdash; denoted by an alias template that is a freestanding item.</ins></p></li>
</ol>
<p>
<ins>-5- A macro is a freestanding item if it is defined in a header synopsis and</ins>
<ol style="list-style-type: none">
<li><p><ins>(5.1) &mdash; the definition is followed by a comment that includes <i>freestanding</i>, or</ins></p></li>
<li><p><ins>(5.2) &mdash; the header synopsis begins with a comment that includes <i>all freestanding.</i></ins></p></li>
</ol>
<p>
<del>-3- In a header synopsis, entities followed with a comment that includes <i>freestanding</i> are freestanding entities.</del>
</p><p>
[<i>Example 1</i>: &hellip; &mdash; <i>end example</i>]
</p><p>
<del>-4- If a header synopsis begins with a comment that includes <i>all freestanding</i>,
 then all of the declarations and macro definitions in the header synopsis are freestanding entities..</del>
</p><p>
[<i>Example 2</i>: &hellip; &mdash; <i>end example</i>]
</p><p>
<del>-5- Deduction guides for freestanding entity class templates are freestanding
entities.</del>
</p><p>
<del>-6- Enclosing namespaces of freestanding entities are freestanding entities.</del>
</p><p>
<del>-7- Friends of freestanding entities are freestanding entities.</del>
</p><p>
<del>-8- Entities denoted by freestanding entity <i>typedef-name</i>s and freestanding entity alias templates are freestanding entities.</del>
</p>
</blockquote>
</li>

<li><p>Modify 16.4.2.5 <a href="https://wg21.link/compliance">[compliance]</a> as indicated:</p>

<blockquote>
<p>
-3- For each of the headers listed in Table 28, a freestanding implementation provides at least the freestanding
<del>entities</del><ins>items</ins> (16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.<del>entity</del><ins>item</ins>]</a>) 
declared in the header.
</p>
</blockquote>
</li>

<li><p>Modify 22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> as indicated:</p>

<blockquote>
<p>
-3- Placeholders are freestanding <del>entities</del><ins>items</ins> 
(16.3.3.6 <a href="https://wg21.link/freestanding.entity">[freestanding.<del>entity</del><ins>item</ins>]</a>).
</p>
</blockquote>
</li>
</ol>






<hr>
<h3><a name="3766" href="https://cplusplus.github.io/LWG/lwg-active.html#3766">3766</a>. <tt>view_interface::cbegin</tt> is underconstrained</h3>
<p><b>Section:</b> 26.5.3.1 <a href="https://wg21.link/view.interface.general">[view.interface.general]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Hewill Kang <b>Opened:</b> 2022-09-04 <b>Last modified:</b> 2022-11-11</p>
<p><b>Priority: </b>2
</p>
<p><b>View other</b> <a href="https://cplusplus.github.io/LWG/lwg-index-open.html#view.interface.general">active issues</a> in [view.interface.general].</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#view.interface.general">issues</a> in [view.interface.general].</p>
<p><b>Discussion:</b></p>
<p>
Currently, <tt>view_interface::cbegin</tt> simply returns <tt>ranges::cbegin(<i>derived</i>())</tt>, 
which returns the type alias <tt>const_iterator</tt> for its iterator, which requires that the template 
parameter <tt>I</tt> must model the <tt>input_iterator</tt>.
</p><p>
Given that <tt>view_interface::cbegin</tt> does not have any constraints, when <tt>D</tt> models only 
<tt>output_range</tt>, calling its <tt>cbegin()</tt> will result in a hard error inside the function body:
</p>
<blockquote><pre>
#include &lt;ranges&gt;
#include &lt;vector&gt;

int main() {
  std::vector&lt;int&gt; v;
  auto r = std::views::counted(std::back_inserter(v), 3);
  auto b = r.cbegin(); // <span style="color:red;font-weight:bolder">hard error</span>
}
</pre></blockquote>
<p>
We should add a constraint for <tt>view_interface::cbegin</tt> that <tt>D</tt> must model <tt>input_range</tt>.
</p>

<p><i>[2022-09-23; Reflector poll]</i></p>

<p>
Set priority to 2 after reflector poll.
</p>
<p>
This should be done for <tt>cend</tt> too.
</p>

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

<ol>

<li><p>Modify 26.5.3.1 <a href="https://wg21.link/view.interface.general">[view.interface.general]</a> as indicated:</p>

<blockquote>
<pre>
namespace std::ranges {
  template&lt;class D&gt;
    requires is_class_v&lt;D&gt; &amp;&amp; same_as&lt;D, remove_cv_t&lt;D&gt;&gt;
  class view_interface {
    [&hellip;]
  public:
    [&hellip;]
    constexpr auto cbegin() <ins>requires input_range&lt;D&gt;</ins> {
      return ranges::cbegin(<i>derived</i>());
    }
    constexpr auto cbegin() const requires <ins>input_</ins>range&lt;const D&gt; {
      return ranges::cbegin(<i>derived</i>());
    }
    [&hellip;]
  };
}
</pre>
</blockquote>
</li>

</ol>
</blockquote>

<p><i>[2022-09-25; Hewill provides improved wording]</i></p>


<p><i>[Kona 2022-11-08; Accepted at joint LWG/SG9 session. Move to Immediate]</i></p>




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

<ol>

<li><p>Modify 26.5.3.1 <a href="https://wg21.link/view.interface.general">[view.interface.general]</a> as indicated:</p>

<blockquote>
<pre>
namespace std::ranges {
  template&lt;class D&gt;
    requires is_class_v&lt;D&gt; &amp;&amp; same_as&lt;D, remove_cv_t&lt;D&gt;&gt;
  class view_interface {
    [&hellip;]
  public:
    [&hellip;]
    constexpr auto cbegin() <ins>requires input_range&lt;D&gt;</ins> {
      return ranges::cbegin(<i>derived</i>());
    }
    constexpr auto cbegin() const requires <ins>input_</ins>range&lt;const D&gt; {
      return ranges::cbegin(<i>derived</i>());
    }
    constexpr auto cend() <ins>requires input_range&lt;D&gt;</ins> {
      return ranges::cend(<i>derived</i>());
    }
    constexpr auto cend() const requires <ins>input_</ins>range&lt;const D&gt; {
      return ranges::cend(<i>derived</i>());
    }
    [&hellip;]
  };
}
</pre>
</blockquote>
</li>

</ol>





<hr>
<h3><a name="3814" href="https://cplusplus.github.io/LWG/lwg-active.html#3814">3814</a>. Add freestanding items requested by NB comments</h3>
<p><b>Section:</b> 20.2.2 <a href="https://wg21.link/memory.syn">[memory.syn]</a>, 26.2 <a href="https://wg21.link/ranges.syn">[ranges.syn]</a>, 33.5.2 <a href="https://wg21.link/atomics.syn">[atomics.syn]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Ben Craig <b>Opened:</b> 2022-11-06 <b>Last modified:</b> 2022-11-11</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#memory.syn">issues</a> in [memory.syn].</p>
<p><b>Discussion:</b></p>
<p>
This addresses the following NB comments:
</p>
<ul>
<li><p><b><a href="https://github.com/cplusplus/nbballot/issues/440">GB-085</a></b> (20.2.2 <a href="https://wg21.link/memory.syn">[memory.syn]</a> <tt>start_lifetime_as</tt> and <tt>start_lifetime_as_array</tt> should be freestanding)</p></li>
<li><p><b><a href="https://github.com/cplusplus/nbballot/issues/439">GB-110</a></b> (26.2 <a href="https://wg21.link/ranges.syn">[ranges.syn]</a> New views should be freestanding (<tt>repeat</tt>, <tt>stride</tt>, <tt>cartesian_product</tt>))</p></li>
<li><p>(partial) <b><a href="https://github.com/cplusplus/nbballot/issues/442">GB-130</a></b> (33.5.2 <a href="https://wg21.link/atomics.syn">[atomics.syn]</a> <tt>memory_order_acquire</tt> etc should be freestanding)</p></li>
</ul>
<p>
The explicit lifetime management functions requested by GB-085 have not been reviewed by LEWG in the context of freestanding, 
but they seem non-controversial in that context. None of the requested lifetime management functions run any code.  
I believe these were missed in post-merge conflict searches because the papers weren't targeted to LEWG or LWG at the time
of those searches.
</p><p>
The ranges facilities requested by GB-110 <em>have</em> been reviewed on the LEWG mailing list in the context of freestanding.  
<a href="https://wg21.link/P1642R11">P1642R11</a> mentions the <tt>repeat</tt>, <tt>stride</tt>, and <tt>cartesian_product</tt> papers in "Potential Post-LEWG 
merge conflicts". All were discussed in an April 2022 reflector discussion and received six votes in favor of allowing these papers 
into freestanding, with no opposition.
</p><p>
The atomics facilities requested by GB-130 are essentially new names for existing facilities. Marking these as freestanding isn't 
concerning. There are concerns in GB-130 dealing with the specification details of freestanding enums, but those concerns won't be 
addressed in this issue.
</p>

<p><i>[Kona 2022-11-07; Move to Immediate]</i></p>




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

<ol>
<li><p>Modify 20.2.2 <a href="https://wg21.link/memory.syn">[memory.syn]</a>, header <tt>&lt;memory&gt;</tt> synopsis, as indicated:</p>

<blockquote>
<pre>
[&hellip;]
<i>// 20.2.6 <a href="https://wg21.link/obj.lifetime">[obj.lifetime]</a>, explicit lifetime management</i>
template&lt;class T&gt;
  T* start_lifetime_as(void* p) noexcept; <ins>// <i>freestanding</i></ins>
template&lt;class T&gt;
  const T* start_lifetime_as(const void* p) noexcept; <ins>// <i>freestanding</i></ins>
template&lt;class T&gt;
  volatile T* start_lifetime_as(volatile void* p) noexcept; <ins>// <i>freestanding</i></ins>
template&lt;class T&gt;
  const volatile T* start_lifetime_as(const volatile void* p) noexcept; <ins>// <i>freestanding</i></ins>
template&lt;class T&gt;
  T* start_lifetime_as_array(void* p, size_t n) noexcept; <ins>// <i>freestanding</i></ins>
template&lt;class T&gt;
  const T* start_lifetime_as_array(const void* p, size_t n) noexcept; <ins>// <i>freestanding</i></ins>
template&lt;class T&gt;
  volatile T* start_lifetime_as_array(volatile void* p, size_t n) noexcept; <ins>// <i>freestanding</i></ins>
template&lt;class T&gt;
  const volatile T* start_lifetime_as_array(const volatile void* p, size_t n) noexcept; <ins>// <i>freestanding</i></ins>
[&hellip;]
</pre>
</blockquote>

</li>

<li><p>Modify 26.2 <a href="https://wg21.link/ranges.syn">[ranges.syn]</a>, header <tt>&lt;ranges&gt;</tt> synopsis, as indicated:</p>

<blockquote>
<pre>
[&hellip;]
// <i>26.6.5 <a href="https://wg21.link/range.repeat">[range.repeat]</a>, repeat view</i>
template&lt;move_constructible W, semiregular Bound = unreachable_sentinel_t&gt;
  requires (is_object_v&lt;W&gt; &amp;&amp; same_as&lt;W, remove_cv_t&lt;W&gt;&gt;
    &amp;&amp; (<i>is-integer-like</i>&lt;Bound&gt; || same_as&lt;Bound, unreachable_sentinel_t&gt;))
class repeat_view; <ins>// <i>freestanding</i></ins>

namespace views { inline constexpr <i>unspecified</i> repeat = <i>unspecified</i>; } <ins>// <i>freestanding</i></ins>
[&hellip;]
// <i>26.7.30 <a href="https://wg21.link/range.stride">[range.stride]</a>, stride view</i>
template&lt;input_range V&gt;
  requires view&lt;V&gt;
class stride_view; <ins>// <i>freestanding</i></ins>

template&lt;class V&gt;
  inline constexpr bool enable_borrowed_range&lt;stride_view&lt;V&gt;&gt; = enable_borrowed_range&lt;V&gt;; <ins>// <i>freestanding</i></ins>

namespace views { inline constexpr <i>unspecified</i> stride = <i>unspecified</i>; } <ins>// <i>freestanding</i></ins>

// <i>26.7.31 <a href="https://wg21.link/range.cartesian">[range.cartesian]</a>, cartesian product view</i>
template&lt;input_range First, forward_range... Vs&gt;
  requires (view&lt;First&gt; &amp;&amp; ... &amp;&amp; view&lt;Vs&gt;)
class cartesian_product_view; <ins>// <i>freestanding</i></ins>

namespace views { inline constexpr <i>unspecified</i> cartesian_product = <i>unspecified</i>; } <ins>// <i>freestanding</i></ins>
[&hellip;]
</pre>
</blockquote>

</li>

<li><p>Modify 33.5.2 <a href="https://wg21.link/atomics.syn">[atomics.syn]</a>, header <tt>&lt;atomic&gt;</tt> synopsis, as indicated:</p>

<blockquote>
<pre>
namespace std {
  // <i>33.5.4 <a href="https://wg21.link/atomics.order">[atomics.order]</a>, order and consistency</i>
  enum class memory_order : <i>unspecified</i>; // <i>freestanding</i>
  inline constexpr memory_order memory_order_relaxed = memory_order::relaxed; <ins>// <i>freestanding</i></ins>
  inline constexpr memory_order memory_order_consume = memory_order::consume; <ins>// <i>freestanding</i></ins>
  inline constexpr memory_order memory_order_acquire = memory_order::acquire; <ins>// <i>freestanding</i></ins>
  inline constexpr memory_order memory_order_release = memory_order::release; <ins>// <i>freestanding</i></ins>
  inline constexpr memory_order memory_order_acq_rel = memory_order::acq_rel; <ins>// <i>freestanding</i></ins>
  inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst; <ins>// <i>freestanding</i></ins>
  [&hellip;]
}
</pre>
</blockquote>

</li>

</ol>





<hr>
<h3><a name="3816" href="https://cplusplus.github.io/LWG/lwg-active.html#3816">3816</a>. <tt>flat_map</tt> and <tt>flat_multimap</tt> should impose sequence container requirements</h3>
<p><b>Section:</b> 24.6.9.1 <a href="https://wg21.link/flat.map.overview">[flat.map.overview]</a>, 24.6.10.1 <a href="https://wg21.link/flat.multimap.overview">[flat.multimap.overview]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Tomasz Kamiński <b>Opened:</b> 2022-11-08 <b>Last modified:</b> 2022-11-09</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>Discussion:</b></p>
<p>
This is resolution of <b><a href="https://github.com/cplusplus/nbballot/issues/519">US 42-103</a></b>
(24.6.9.1 <a href="https://wg21.link/flat.map.overview">[flat.map.overview]</a> p6 24.6.10.1 <a href="https://wg21.link/flat.multimap.overview">[flat.multimap.overview]</a> p6 Clearing when restoring invariants).
</p>

<p>
Currently both 24.6.9.1 <a href="https://wg21.link/flat.map.overview">[flat.map.overview]</a> p7 and 24.6.10.1 <a href="https://wg21.link/flat.multimap.overview">[flat.multimap.overview]</a> p7
claims that <tt>flat_(multi)map</tt> supports "Any sequence container (24.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a>) 
<tt>C</tt> supporting <i>Cpp17RandomAccessIterator</i>", which arguably includes <tt>std::array</tt> (see LWG <a href="https://cplusplus.github.io/LWG/lwg-active.html#617">617</a>).
This is incorrect as <tt>std::array</tt> does not provide operations required to restored these adaptors invariant, 
including <tt>clear</tt>. We should require that <tt>C</tt> meets sequence container requirements, and we 
state that fact explicitly in 24.3.7.1 <a href="https://wg21.link/array.overview">[array.overview]</a> p3: "An <tt>array</tt> meets some of the requirements 
of a sequence container (24.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a>)".
</p>

<p><i>[Kona 2022-11-08; Move to Immediate status]</i></p>




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

<ol>

<li><p>Modify 24.6.9.1 <a href="https://wg21.link/flat.map.overview">[flat.map.overview]</a> as indicated:</p>

<blockquote>
<p>
-7- Any <del>sequence container (24.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a>)</del><ins>type</ins> <tt>C</tt> <del>supporting 
   <i>Cpp17RandomAccessIterator</i></del><ins>that meets sequence container requirements (24.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a>)</ins> 
    can be used to instantiate <tt>flat_map</tt>, as long as <ins><tt>C::iterator</tt> meets the <i>Cpp17RandomAccessIterator</i> 
    requirements and</ins> invocations of member functions <tt>C::size</tt> and <tt>C::max_size</tt> 
    do not exit via an exception. In particular, <tt>vector</tt> (24.3.11 <a href="https://wg21.link/vector">[vector]</a>) and <tt>deque</tt> 
    (24.3.8 <a href="https://wg21.link/deque">[deque]</a>) can be used. 
</p>
</blockquote>
</li>

<li><p>Modify 24.6.10.1 <a href="https://wg21.link/flat.multimap.overview">[flat.multimap.overview]</a> as indicated:</p>

<blockquote>
<p>
-7- Any <del>sequence container (24.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a>)</del><ins>type</ins> <tt>C</tt> <del>supporting 
    <i>Cpp17RandomAccessIterator</i></del><ins>that meets sequence container requirements (24.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a>)</ins> 
    can be used to instantiate <tt>flat_multimap</tt>, as long as <ins><tt>C::iterator</tt> meets the <i>Cpp17RandomAccessIterator</i> 
    requirements and</ins> invocations of member functions <tt>C::size</tt> and <tt>C::max_size</tt> do not exit via an 
    exception. In particular, <tt>vector</tt> (24.3.11 <a href="https://wg21.link/vector">[vector]</a>) and <tt>deque</tt> (24.3.8 <a href="https://wg21.link/deque">[deque]</a>) can be used. 
</p>
</blockquote>
</li>


</ol>

<hr>
<h3><a name="3817" href="https://cplusplus.github.io/LWG/lwg-active.html#3817">3817</a>. Missing preconditions on <tt>forward_list</tt> modifiers</h3>
<p><b>Section:</b> 24.3.9.5 <a href="https://wg21.link/forward.list.modifiers">[forward.list.modifiers]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Tomasz Kamiński <b>Opened:</b> 2022-11-08 <b>Last modified:</b> 2022-11-12</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>Discussion:</b></p>
<p>
This is resolution of <b><a href="https://github.com/cplusplus/nbballot/issues/456">GB-101</a></b>
(24.3.9.5 <a href="https://wg21.link/forward.list.modifiers">[forward.list.modifiers]</a> p12,15,20,21 Missing preconditions on forward_list modifiers).
</p>

<p>
Some of the modifiers to <tt>forward_list</tt> are special to that container and accordingly are not described 
in 24.2 <a href="https://wg21.link/container.requirements">[container.requirements]</a>. Specifically, <tt>insert_after</tt> (iterator overload), 
<tt>insert_range_after</tt> and <tt>emplace_after</tt> do not verify that the <tt>value_type</tt> is <i>Cpp17EmplaceConstructible</i>
from the appropriate argument(s).
Furthermore <tt>insert_after</tt> (value overloads) are missing <i>Cpp17CopyInsertable</i>/<i>Cpp17MoveInsertable</i> 
requirements.
</p>

<p><i>[Kona 2022-11-08; Move to Ready]</i></p>

<p><i>[Kona 2022-11-12; Correct status to Immediate]</i></p>




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

<ol>

<li><p>Modify 24.3.9.5 <a href="https://wg21.link/forward.list.modifiers">[forward.list.modifiers]</a> as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note</i>: <tt>emplace_front</tt>, <tt>push_front</tt>, and <tt>prepend_range</tt> are already covered
by 24.2 <a href="https://wg21.link/container.requirements">[container.requirements]</a>. ]
</p>
</blockquote>

<pre>
iterator insert_after(const_iterator position, const T&amp; x);
</pre>
<blockquote>
<p>
<ins>-?- <i>Preconditions:</i> <tt>T</tt> is <i>Cpp17CopyInsertable</i> into <tt>forward_list</tt>.
<tt>position</tt> is <tt>before_begin()</tt> or is a dereferenceable iterator in the range [<tt>begin()</tt>, <tt>end()</tt>).</ins>
</p>
<p>
<ins>-?- <i>Effects:</i> Inserts a copy of <tt>x</tt> after <tt>position</tt>.</ins>
</p>
<p>
<ins>-?- <i>Returns:</i> An iterator pointing to the copy of <tt>x</tt>.</ins>
</p>
</blockquote>

<pre>
iterator insert_after(const_iterator position, T&amp;&amp; x);
</pre>
<blockquote>
<p>
-6- <i>Preconditions:</i> <ins><tt>T</tt> is <i>Cpp17MoveInsertable</i> into <tt>forward_list</tt>.</ins>
    <tt>position</tt> is <tt>before_begin()</tt> or is a dereferenceable iterator in the range [<tt>begin()</tt>, <tt>end()</tt>).
</p>
<p>
-7- <i>Effects:</i> Inserts a copy of <tt>x</tt> after <tt>position</tt>.
</p>
<p>
-8- <i>Returns:</i> An iterator pointing to the copy of <tt>x</tt>.
</p>
</blockquote>

<pre>
iterator insert_after(const_iterator position, size_type n, const T&amp; x);
</pre>
<blockquote>
<p>
-9- <i>Preconditions:</i> <ins><tt>T</tt> is <i>Cpp17CopyInsertable</i> into <tt>forward_list</tt>.</ins>
    <tt>position</tt> is <tt>before_begin()</tt> or is a dereferenceable iterator in the range [<tt>begin()</tt>, <tt>end()</tt>).
</p>
<p>
-10- <i>Effects:</i> Inserts <tt>n</tt> copies of <tt>x</tt> after <tt>position</tt>.
</p>
<p>
-11- <i>Returns:</i> An iterator pointing to the last inserted copy of <tt>x</tt><ins>,</ins> or <tt>position</tt> 
     if <tt>n == 0</tt> <ins>is <tt>true</tt></ins>.
</p>
</blockquote>

<pre>
template&lt;class InputIterator&gt;	
  iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
</pre>
<blockquote>
<p>
-12- <i>Preconditions:</i> <ins><tt>T</tt> is <i>Cpp17EmplaceConstructible</i> into <tt>forward_list</tt> from <tt>*first</tt>.</ins>
     <tt>position</tt> is <tt>before_begin()</tt> or is a dereferenceable iterator in the range [<tt>begin()</tt>, <tt>end()</tt>).
     Neither <tt>first</tt> nor <tt>last</tt> are iterators in <tt>*this</tt>.
</p>
<p>
-13- <i>Effects:</i> Inserts copies of elements in [<tt>first</tt>, <tt>last</tt>) after <tt>position</tt>.
</p>
<p>
-14- <i>Returns:</i> An iterator pointing to the last inserted element<ins>,</ins> or <tt>position</tt> if <tt>first == last</tt> 
     <ins>is <tt>true</tt></ins>.
</p>
</blockquote>

<pre>
template&lt;<i>container-compatible-range</i>&lt;T&gt; R&gt;
  iterator insert_after(const_iterator position, R&amp;&amp; rg);
</pre>
<blockquote>
<p>
-15- <i>Preconditions:</i> <ins><tt>T</tt> is <i>Cpp17EmplaceConstructible</i> into <tt>forward_list</tt> from <tt>*ranges::begin(rg)</tt>.</ins>
     <tt>position</tt> is <tt>before_begin()</tt> or is a dereferenceable iterator in the range [<tt>begin()</tt>, <tt>end()</tt>).
     <tt>rg</tt> and <tt>*this</tt> do not overlap.
</p>
<p>
-16- <i>Effects:</i> Inserts copies of elements in range <tt>rg</tt> after <tt>position</tt>.
</p>
<p>
-17- <i>Returns:</i> An iterator pointing to the last inserted element, or <tt>position</tt> if <tt>rg</tt> is empty.
</p>
</blockquote>

<pre>
iterator insert_after(const_iterator position, initializer_list&lt;T&gt; il);
</pre>
<blockquote>
<p>		
-18- <i>Effects:</i> <ins>Equivalent to: <tt>return</tt></ins> <tt>insert_after(position, il.begin(), il.end())</tt><del>.</del><ins>;</ins>
</p>
<p>
<del>-19- <i>Returns:</i> An iterator pointing to the last inserted element or <tt>position</tt> if <tt>il</tt> is empty.</del>
</p>
</blockquote>

<pre>
template&lt;class... Args&gt;	
  iterator emplace_after(const_iterator position, Args&amp;&amp;... args);
</pre>
<blockquote>
<p>
-20- <i>Preconditions:</i> <ins><tt>T</tt> is <i>Cpp17EmplaceConstructible</i> into <tt>forward_list</tt> from 
     <tt>std::forward&lt;Args&gt;(args)...</tt>.</ins>
     <tt>position</tt> is <tt>before_begin()</tt> or is a dereferenceable iterator in the range [<tt>begin()</tt>, <tt>end()</tt>).
</p>
<p>
-21- <i>Effects:</i> Inserts an object of type <tt>value_type</tt> <del>constructed</del><ins>direct-non-list-initialized</ins> 
with <tt><del>value_type(</del>std::forward&lt;Args&gt;(args)...<del>)</del></tt> after <tt>position</tt>.
</p>
<p>
-22- <i>Returns:</i> An iterator pointing to the new object.
</p>
</blockquote>

</li>
</ol>


<hr>
<h3><a name="3818" href="https://cplusplus.github.io/LWG/lwg-active.html#3818">3818</a>. Exposition-only concepts are not described in library intro</h3>
<p><b>Section:</b> 16.3.3 <a href="https://wg21.link/conventions">[conventions]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Tim Song <b>Opened:</b> 2022-11-08 <b>Last modified:</b> 2022-11-12</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>Discussion:</b></p>
<p>
This is the resolution for <b><a href="https://github.com/cplusplus/nbballot/issues/435">GB-074</a></b>.
</p>

<p>
The comment is:
</p>

<blockquote>
<p>
16.3.3.2 <a href="https://wg21.link/expos.only.func">[expos.only.func]</a> introduces exposition-only function templates. 16.3.3.3.2 <a href="https://wg21.link/expos.only.types">[expos.only.types]</a> introduces
exposition-only types. 16.3.3.5 <a href="https://wg21.link/objects.within.classes">[objects.within.classes]</a> introduces exposition-only private members.
</p><p>
There is nothing about exposition-only concepts, despite them being used extensively in the library clauses.
</p><p>
The same problem exists for exposition-only variable templates.
</p>
</blockquote>

<p><i>[Kona 2022-11-08; Move to Immediate status]</i></p>


<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<ol>
<li><p>Modify 16.3.3.2 <a href="https://wg21.link/expos.only.func">[expos.only.func]</a> as indicated, changing the stable name:</p>
<blockquote>
<p>
<b>16.3.3.2 Exposition-only <del>functions</del><ins>entities</ins> [expos.only.<del>func</del><ins>entity</ins>]</b>
</p><p>
-1- Several <del>function templates</del><ins>entities</ins> defined in 17 <a href="https://wg21.link/support">[support]</a> 
through 33 <a href="https://wg21.link/thread">[thread]</a> and D <a href="https://wg21.link/depr">[depr]</a> are only defined for the purpose of exposition. 
The declaration of such <del>a function</del><ins>an entity</ins> is followed by a comment ending in <i>exposition only</i>.
</p>
</blockquote>
</li>

<li><p>Strike 16.3.3.3.2 <a href="https://wg21.link/expos.only.types">[expos.only.types]</a> as redundant:</p>

<blockquote>
<p>
<del><b>16.3.3.3.2 Exposition-only types [expos.only.types]</b></del>
</p><p>

<del>-1- Several types defined in 17 <a href="https://wg21.link/support">[support]</a> through 33 <a href="https://wg21.link/thread">[thread]</a> and D <a href="https://wg21.link/depr">[depr]</a> 
are defined for the purpose of exposition. The declaration of such a type is followed by a 
comment ending in <i>exposition only</i>.</del>
</p><p>
<del><i>[Example 1:</i></del>
</p>
<blockquote>
<pre>
<del>namespace std {
  extern "C" using <i>some-handler</i> = int(int, void*, double);  // exposition only
}</del>
</pre>
</blockquote>

<p>
<del>The type placeholder <i><tt>some-handler</tt></i> can now be used to specify a 
function that takes a callback parameter with C language linkage. 
<i>&mdash; end example]</i></del>
</p>
</blockquote>
</li>
</ol>
</blockquote>

<p><i>[2022-11-09 Tim reopens]</i></p>

<p>
During LWG review of <a href="https://cplusplus.github.io/LWG/lwg-active.html#3753">3753</a>, it was pointed out that <i>typedef-name</i>s are not necessarily entities.
</p>

<p><i>[Kona 2022-11-11; Move to Immediate]</i></p>




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

<ol>
<li><p>Modify 16.3.3.2 <a href="https://wg21.link/expos.only.func">[expos.only.func]</a> as indicated, changing the stable name:</p>

<blockquote>
<p>
<b>16.3.3.2 Exposition-only <del>functions</del><ins>entities, etc.</ins> [expos.only.<del>func</del><ins>entity</ins>]</b>
</p><p>
-1- Several <del>function templates</del><ins>entities and <i>typedef-name</i>s</ins> defined in 17 <a href="https://wg21.link/support">[support]</a> 
through 33 <a href="https://wg21.link/thread">[thread]</a> and D <a href="https://wg21.link/depr">[depr]</a> are only defined for the purpose of exposition. 
The declaration of such <del>a function</del><ins>an entity or <i>typedef-name</i></ins> is followed by a comment ending in <i>exposition only</i>.
</p>
</blockquote>
</li>

<li><p>Strike 16.3.3.3.2 <a href="https://wg21.link/expos.only.types">[expos.only.types]</a> as redundant:</p>

<blockquote>
<p>
<del><b>16.3.3.3.2 Exposition-only types [expos.only.types]</b></del>
</p><p>

<del>-1- Several types defined in 17 <a href="https://wg21.link/support">[support]</a> through 33 <a href="https://wg21.link/thread">[thread]</a> and D <a href="https://wg21.link/depr">[depr]</a> 
are defined for the purpose of exposition. The declaration of such a type is followed by a 
comment ending in <i>exposition only</i>.</del>
</p><p>
<del><i>[Example 1:</i></del>
</p>
<blockquote>
<pre>
<del>namespace std {
  extern "C" using <i>some-handler</i> = int(int, void*, double);  // exposition only
}</del>
</pre>
</blockquote>

<p>
<del>The type placeholder <i><tt>some-handler</tt></i> can now be used to specify a 
function that takes a callback parameter with C language linkage. 
<i>&mdash; end example]</i></del>
</p>
</blockquote>
</li>
</ol>





<hr>
<h3><a name="3822" href="https://cplusplus.github.io/LWG/lwg-active.html#3822">3822</a>. Avoiding normalization in <tt>filesystem::weakly_canonical</tt></h3>
<p><b>Section:</b> 31.12.13.40 <a href="https://wg21.link/fs.op.weakly.canonical">[fs.op.weakly.canonical]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> US <b>Opened:</b> 2022-11-08 <b>Last modified:</b> 2022-11-10</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#fs.op.weakly.canonical">issues</a> in [fs.op.weakly.canonical].</p>
<p><b>Discussion:</b></p>
<p>
This addresses NB comment
<b><a href="https://github.com/cplusplus/nbballot/issues/448">US-60-125</a></b>
(31.12.13.40 <a href="https://wg21.link/fs.op.weakly.canonical">[fs.op.weakly.canonical]</a> Avoiding normalization)
</p>

<p>
NB comment: "Implementations cannot avoid normalization because arbitrary file system 
changes may have occurred since any previous call. Proposed change:
Remove the paragraph."
</p>

<p><i>[Kona 2022-11-07; LWG review]</i></p>

<p>
Discussion revolved around two different interpretations of the <i>Remarks</i>:
<ul>
<li>
It's normative recommendation for <tt>path</tt> objects to cache some kind of
flag that indicates they are in a normalized form, which would be checked in
<tt>weakly_canonical</tt> to avoid normalizing again. This is the interpretation
assumed by the NB comment, which correctly notes that such caching would be
unreliable.
</li>
<li>
It's an optimization hint to implementors that they should not normalize the
result if each component has been canonicalized one-by-one. That is, when
canonicalizing <tt>"/a/b/c"</tt> by incrementally building up canonicalized 
components, if the entire path exists then the result will already have been
normalized and should not be normalized again explicitly.
</li>
</ul>
<p>
For the first interpretation, the recommendation is a bad recommendation and
should be removed as suggested by the comment. For the second interpretation,
we don't need to give hints to implementors about not doing unnecessary work;
they already know they shouldn't do that. Either way, it should go.
</p>

<p><i>[Kona 2022-11-09; Move to Immediate]</i></p>




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

<ol>
<li><p>Modify 31.12.13.40 <a href="https://wg21.link/fs.op.weakly.canonical">[fs.op.weakly.canonical]</a> as indicated:</p>

<blockquote><pre>
path filesystem::weakly_canonical(const path&amp; p);
path filesystem::weakly_canonical(const path&amp; p, error_code&amp; ec);
</pre>
<blockquote>
<p>-1- <i>Effects</i>: Using <tt>status(p)</tt> or <tt>status(p, ec)</tt>,
respectively, to determine existence, return a path composed by
<tt>operator/=</tt> from the result of calling <tt>canonical()</tt> with
a path argument composed of the leading elements of <tt>p</tt> that exist,
if any, followed by the elements of <tt>p</tt> that do not exist, if any.
For the first form, <tt>canonical()</tt> is called without an <tt>error_code</tt> argument.
For the second form, <tt>canonical()</tt> is called with <tt>ec</tt> as an
<tt>error_code</tt> argument, and <tt>path()</tt> is returned at the first
error occurrence, if any.
</p>
<p>-2- <i>Postconditions</i>: The returned path is in normal form
(31.12.6.2 <a href="https://wg21.link/fs.path.generic">[fs.path.generic]</a>).</p>
<p> -3- <i>Returns</i>: <tt>p</tt> with symlinks resolved and the result
normalized (31.12.6.2 <a href="https://wg21.link/fs.path.generic">[fs.path.generic]</a>).</p>
<p>-4- <i>Throws</i>: As specified in 31.12.5 <a href="https://wg21.link/fs.err.report">[fs.err.report]</a>.</p>
<p><del>-5- <i>Remarks</i>: Implementations should avoid unnecessary
normalization such as when <tt>canonical</tt> has already been called
on the entirety of <tt>p</tt>.</del>
</p>
</blockquote>
</blockquote>
</li>
</ol>






<hr>
<h3><a name="3823" href="https://cplusplus.github.io/LWG/lwg-active.html#3823">3823</a>. Unnecessary precondition for <tt>is_aggregate</tt></h3>
<p><b>Section:</b> 21.3.5.4 <a href="https://wg21.link/meta.unary.prop">[meta.unary.prop]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Tomasz Kamiński <b>Opened:</b> 2022-11-09 <b>Last modified:</b> 2022-11-10</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View other</b> <a href="https://cplusplus.github.io/LWG/lwg-index-open.html#meta.unary.prop">active issues</a> in [meta.unary.prop].</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#meta.unary.prop">issues</a> in [meta.unary.prop].</p>
<p><b>Discussion:</b></p>
<p>
This is resolution of <b><a href="https://github.com/cplusplus/nbballot/issues/449">GB-090</a></b>
(21.3.5.4 <a href="https://wg21.link/meta.unary.prop">[meta.unary.prop]</a> Unnecessary precondition for <tt>is_aggregate</tt>).
</p>

<p>
The precondition for <tt>is_aggregate</tt> is "<tt>remove_all_extents_t&lt;T&gt;</tt> shall be a complete type 
or <i>cv</i> <tt>void</tt>." This means that <tt>is_aggregate_v&lt;Incomplete[2]&gt;</tt> is undefined, but 
an array is always an aggregate, we don't need a complete element type to know that.	
</p>

<p>
Historically the <tt>is_aggregate</tt> was introduced by LWG <a href="https://cplusplus.github.io/LWG/lwg-defects.html#2911">2911</a> as part of the resolution of the NB comments.
The comment proposed to introduce this trait with requirement "<tt>remove_all_extents_t&lt;T&gt;</tt> shall 
be a complete type, an array type, or (possibly <i>cv</i>-qualified) <tt>void</tt>.",
that is close to resolution proposed in this issue.
According to notes this was simplified during review, after realizing that <tt>remove_all_extents_t&lt;T&gt;</tt> 
is never an array type.
</p>

<p><i>[Kona 2022-11-09; Move to Immediate]</i></p>




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

<ol>
<li><p>Modify 21.3.3 <a href="https://wg21.link/meta.type.synop">[meta.type.synop]</a>, Table 46 ([tab:meta.unary.prop]) &mdash;
"Type property predicates" &mdash; as indicated:</p>

<blockquote>
<table border="1">
<caption>Table 48: Type property predicates [tab:meta.unary.prop]</caption>
<tr>
<th align="center">Template</th>
<th align="center">Condition</th>
<th align="center">Preconditions</th>
</tr>

<tr>
<td colspan="3" align="center">
<tt>&hellip;</tt>
</td>
</tr>

<tr>
<td>
<tt>template&lt;class T, class U&gt;<br/>
struct is_aggregate;</tt>
</td>

<td>
<tt>T</tt> is an aggregate type (9.4.2 <a href="https://wg21.link/dcl.init.aggr">[dcl.init.aggr]</a>)	
</td>

<td>
<tt><del>remove_all_extents_t&lt;</del>T<del>&gt;</del></tt> shall be <ins>an array type,</ins> 
a complete type<ins>,</ins> or <i>cv</i> <tt>void</tt>.
</td>
</tr>

</table>
</blockquote>

</li>
</ol>





<hr>
<h3><a name="3824" href="https://cplusplus.github.io/LWG/lwg-active.html#3824">3824</a>. Number of <tt>bind</tt> placeholders is underspecified</h3>
<p><b>Section:</b> 22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Tomasz Kamiński <b>Opened:</b> 2022-11-09 <b>Last modified:</b> 2022-11-10</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="https://cplusplus.github.io/LWG/lwg-index.html#func.bind.place">issues</a> in [func.bind.place].</p>
<p><b>Discussion:</b></p>
<p>
This is resolution of <b><a href="https://github.com/cplusplus/nbballot/issues/437">GB-95</a></b>
(22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> Number of <tt>bind</tt> placeholders is underspecified).
</p>

<p>
22.10.2 <a href="https://wg21.link/functional.syn">[functional.syn]</a> and 22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> both contain a comment that says 
"M is the implementation-defined number of placeholders". 
There is no wording anywhere to say that there is any such number, only that comment.
</p>

<p><i>[Kona 2022-11-09; Move to Immediate]</i></p>




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

<ol>

<li><p>Modify 22.10.15.5 <a href="https://wg21.link/func.bind.place">[func.bind.place]</a> as indicated:</p>

<blockquote>
<pre>
namespace std::placeholders {
  <i>// M is the <del>implementation-defined</del> number of placeholders</i>
  <i>see below</i> _1;
  <i>see below</i> _2;
              .
              .
              .
  <i>see below</i> _M;
}
</pre>
<blockquote>
<p>
<ins>-?- The number <code>M</code> of placeholders is implementation-defined.</ins>
</p>
<p>
-1- All placeholder types meet the <i>Cpp17DefaultConstructible</i> and <i>Cpp17CopyConstructible</i> requirements, 
and their default constructors and copy/move constructors are constexpr functions that do not throw exceptions.
It is implementation-defined whether placeholder types meet the <i>Cpp17CopyAssignable</i> requirements, but if so, 
their copy assignment operators are constexpr functions that do not throw exceptions.
</p>
</blockquote>
</blockquote>

</li>
</ol>


<hr>
<h3><a name="3826" href="https://cplusplus.github.io/LWG/lwg-active.html#3826">3826</a>. Redundant specification [for overload of <tt>yield_value</tt>]</h3>
<p><b>Section:</b> 26.8.5 <a href="https://wg21.link/coro.generator.promise">[coro.generator.promise]</a> <b>Status:</b> <a href="https://cplusplus.github.io/LWG/lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> US <b>Opened:</b> 2022-11-10 <b>Last modified:</b> 2022-11-12</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>Discussion:</b></p>
<p>
This is in resolution of <b><a href="https://github.com/cplusplus/nbballot/issues/531">US 56-118</a></b>
(26.8.5 <a href="https://wg21.link/coro.generator.promise">[coro.generator.promise]</a> Redundant specification).
</p>
<p>
[Paragraph 14] is redundant given [paragraphs] 13 and 12. Remove it.
</p>
<p>
Paragraphs 12 and 14 are identical: "<i>Remarks</i>: A <i>yield-expression</i> that calls this
function has type <tt>void</tt> (7.6.17 <a href="https://wg21.link/expr.yield">[expr.yield]</a>)." Paragraph 13 states that the overload
of <tt>yield_value</tt> that accepts <tt>ranges::elements_of</tt> for arbitrary ranges has
"<i>Effects</i>: Equivalent to:" calling the overload of <tt>yield_value</tt> that accepts
specializations of <tt>generator</tt>, which paragraph 12 specifies. Per
16.3.2.4 <a href="https://wg21.link/structure.specifications">[structure.specifications]</a> paragraph 4, the former overload "inherits" the
<i>Remarks</i> of paragraph 12 making paragraph 14 redundant.
</p>
<p>
LWG is concerned that the redundancy is not immediately obvious &mdash; it depends on an understanding of
how await expressions function &mdash; so we'd like to preserve comment despite that we agree that it is
normatively redundant.
</p>

<p><i>[2022-11-10 Casey provides wording]</i></p>

<p><i>[Kona 2022-11-11; Move to Immediate]</i></p>



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

<ol>

<li><p>Modify 26.8.5 <a href="https://wg21.link/coro.generator.promise">[coro.generator.promise]</a> as indicated:</p>

<blockquote>
<pre>
template&lt;ranges::input_range R, class Alloc&gt;
  requires convertible_to&lt;ranges::range_reference_t&lt;R&gt;, yielded&gt;
    auto yield_value(ranges::elements_of&lt;R, Alloc&gt; r) noexcept;
</pre>
<blockquote>
<p>
-13- <i>Effects</i>: Equivalent to: [&hellip;]
</p>
<p>
-14- <del><i>Remarks</i>:</del> <ins>[<i>Note 1</i>:</ins> A <i>yield-expression</i> that calls this function has type <tt>void</tt>
(7.6.17 <a href="https://wg21.link/expr.yield">[expr.yield]</a>). <ins>&mdash; <i>end note</i>]</ins>
</p>
</blockquote>
</blockquote>

</li>
</ol>


</body>
</html>
