Skip to content

Commit

Permalink
Wording improvement as suggested by submitter
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani-Hub committed Oct 14, 2023
1 parent 62b66f4 commit 51bd859
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xml/issue3996.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ int main() {
In the above example, <tt>ranges::for_each</tt> requires <tt>indirect_unary_predicate&lt;Pred, projected&lt;I, identity&gt;&gt;</tt>
which ultimately requires <tt>invocable&lt;Pred&amp;, iter_common_reference_t&lt;projected&lt;I, identity&gt;&gt;&gt;</tt>.
<p/>
According to the current wording, the reference and value type of <tt>projected&lt;I, identity&gt;</tt> are <tt>filter_view&amp;&amp;</tt>
and <tt>filter_view&amp;</tt> respectively, which causes its common reference to be eventually calculated as
<tt>const filter_view&amp;</tt>. Since the former is not <tt>const</tt>-iterable, this results in a hard error during
instantiation because <tt>const begin</tt> is called unexpectedly in an unconstrained lambda.
According to the current wording, the reference and indirect value type of <tt>projected&lt;I, identity&gt;</tt> are
<tt>filter_view&amp;&amp;</tt> and <tt>filter_view&amp;</tt> respectively, which causes its common reference to be eventually
calculated as <tt>const filter_view&amp;</tt>. Since the former is not <tt>const</tt>-iterable, this results in a hard error
during instantiation because <tt>const begin</tt> is called unexpectedly in an unconstrained lambda.
</p>
<p>
It seems like having <tt>projected&lt;I, identity&gt;</tt> just be <tt>I</tt> is a more appropriate choice,
Expand Down

0 comments on commit 51bd859

Please sign in to comment.