<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Proposed wording for LWG 2114 (contextually convertible to <tt>bool</tt>)</title>

<style type="text/css">
  p {text-align:justify}
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  blockquote.note
  {
   background-color:#E0E0E0;
   padding-left: 15px;
   padding-right: 15px;
   padding-top: 1px;
   padding-bottom: 1px;
  }
  div#refs p { padding-left: 32px; text-indent: -32px; }
</style>
</head><body>
<address style="text-align: left;">
Document number: P2167R1<br>
Date: 2021-07-15<br>
Audience: Library Working Group<br>
Author: Daniel Kr&uuml;gler<br>
Reply-to: <a href="mailto:daniel.kruegler@gmail.com">Daniel Kr&uuml;gler</a>
</address>
<hr>
<h1 style="text-align: center;">Improved Proposed Wording for LWG 2114</br>(contextually convertible to <tt>bool</tt>)</h1>

<ul>
<li><a href="#Intro">Introduction</a></li>
<li><a href="#RevisionHistory">Revision History</a></li>
<li><a href="#Discussion">Discussion</a></li>
<li><a href="#Rationale">Rationale</a></li>
<li><a href="#Issues_Resolved">Resolved Issues</a></li>
<li><a href="#Proposed_resolution">Proposed Resolution</a></li>
<li><a href="#Akn">Acknowledgements</a></li>
<li><a href="#Bibliography">Bibliography</a></li>
</ul>

<h2><a name="Intro"></a>Introduction</h2>
<p>
This proposal is intended to provide wording to resolve the existing library 
issue <a href="https://wg21.link/lwg2114">LWG 2114</a>.
</p>

<h2><a name="RevisionHistory"></a>Revision History</h2>
<p>
Changes since <a href="https://wg21.link/p2167r0">P2167R0</a>:
</p>
<ul>
<li><p>
Remove changes suggested for 26.7.3.2 [valarray.comparison]. For the same reason as e.g. for 20.6.6 [optional.relops]
and 23.5.1.8 [reverse.iter.cmp] the result is just converted to <tt>bool</tt> and nothing else is done with it.
</li></p>
<li><p>
Rebase wording to <a href="https://wg21.link/n4892">N4892</a>.
</li></p>
<li><p>
Improve document title.
</li></p>
</ul>

<h2><a name="Discussion"></a>Discussion</h2>
<p>
Issue <a href="https://wg21.link/lwg2114">LWG 2114</a> has already a long history and a number of
wording revisions that went backward and forward. But with the introduction of the <tt><i>boolean-testable</i></tt>
exposition-only concept by <a href="https://wg21.link/p1964r2">P1964R2</a> adopted during the Prague 2020 meeting 
we have now an officially accepted useful tool that can be used to fix this issue.
<p/>
Since the edits of the working draft are not very small, this paper has been written.
</p>

<h2><a name="Rationale"></a>Rationale</h2>
<p>
The <tt><i>boolean-testable</i></tt> has all the properties that <a href="https://wg21.link/lwg2114">LWG 2114</a> tried
to specify without having language-concepts available. Our existing terminology of "modeling" a concept should
allow us to use this wording even when we specify something within existing named requirements sets. So the approach
of this paper is just to impose the <tt><i>boolean-testable</i></tt> concept requirements to those places that
the issue identifies, now updated to the most recent working draft.
<p/>
The following guidelines have been chosen to decide for applying the <tt><i>boolean-testable</i></tt> concept 
requirements below:
</p>
<ul>
<li><p>Type families that are potentially influenced by user-defined types, such as types 
meeting the <i>Cpp17NullablePointer</i> requirements, are usually good candidates, unless
the <tt>bool</tt>-like expressions are purposely intended to reflect the exact behaviour 
as presented (The design of the comparison functions of <tt>optional</tt> belong into this category)</p></li>
<li><p>Type families or specifications that solely exist to shorten the specification of
library-provided types, should usually <em>not</em> be good candidates, unless the intention
exists here to provide Library implementors more freedom. An example for this case are
the Container requirements which are actually invented to shorten the specification of the
existing concrete container templates, where all of them use a concrete type <tt>bool</tt> for
<tt>operator==/!=</tt> and for the <tt>empty</tt> function
</p>
<blockquote class="note">
<p>
It should be pointed out that in the past we had considered to take advantage of "convertible to <tt>bool</tt>"
requirements for allocator equality by allowing to implement them as <tt>constexpr</tt> with 
<tt>std::true/false_type</tt> as return types, but with the introduction of the <tt>is_always_equal</tt>
query type of an allocator we had withdrawn this idea, so at the moment we have no need for such
a customization point. If we really want to return to a similar point again, we can easily decide to
change the return type e.g. for container equality again to model <tt><i>boolean-testable</i></tt>, but
now specifically to realize a concrete purpose.
</p>
</blockquote>
</li>
</ul>

<h2><a name="Issues_Resolved"></a>Resolved Issues</h2>
<p>
If the proposed resolution will be accepted, the following library issues will be resolved:
</p>
<table border="1">
  <tr>
    <th>Number</th>
    <th>Description</th>
  </tr>
  <tr>
    <td><a href="https://wg21.link/lwg2114">LWG 2114</a></td>
    <td>Incorrect "<i>contextually</i> convertible to <tt>bool</tt>" requirements</td>
  </tr>
</table> 

<h2><a name="Proposed_resolution"></a>Proposed resolution</h2>

<p>
The proposed wording changes refer to <a href="https://wg21.link/n4892">N4892</a>.
</p>

<ol>
<li><p>Change Table [tab:cpp17.equalitycomparable] as indicated:</p>

<table border="1">
<caption>Table 25: <i>Cpp17EqualityComparable</i> requirements [tab:cpp17.equalitycomparable]</caption>

<tr>
<th>Expression</th>
<th>Return type</th>
<th>Requirement</th>
</tr>

<tr>
<td><tt>a == b</tt></td>
<td><del>convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a == b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>==</tt> is an equivalence relation, that is, it has the<br/>
following properties: [&hellip;]<br/>
</td>
</tr>

</table>
</li>

<li><p>Change Table [tab:cpp17.lessthancomparable] as indicated:</p>

<table border="1">
<caption>Table 26: <i>Cpp17LessThanComparable</i> requirements [tab:cpp17.lessthancomparable]</caption>

<tr>
<th>Expression</th>
<th>Return type</th>
<th>Requirement</th>
</tr>

<tr>
<td><tt>a &lt; b</tt></td>
<td><del>convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a &lt; b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>&lt;</tt> is a strict weak ordering relation (25.8 [alg.sorting])<br/>
</td>
</tr>

</table>
</li>

<li><p>Change in [nullablepointer.requirements] Table [tab:cpp17.nullablepointer] as indicated:</p>

<blockquote>

<table border="1">
<caption>Table 33: <i>Cpp17NullablePointer</i> requirements [tab:cpp17.nullablepointer]</caption>

<tr>
<th>Expression</th>
<th>Return type</th>
<th>Operational semantics</th>
</tr>

<tr>
<td colspan="3" style="text-align:center;">&hellip;</td> 
</tr>

<tr>
<td><tt>a != b</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a != b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>!(a == b)</tt></td>
</tr>

<tr>
<td><tt>a == np<br/>np == a</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a == np)</tt> and <tt>decltype(np == a)</tt></ins><br/>
<ins>both model <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>a == P()</tt></td>
</tr>

<tr>
<td><tt>a != np<br/>np != a</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a != np)</tt> and <tt>decltype(np != a)</tt></ins><br/>
<ins>both model <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>!(a == np)</tt></td>
</tr>

</table>
</blockquote>
</li>

<li><p>Change 17.11.6 [cmp.alg] as indicated:</p>

<blockquote>
<p>
-4- The name <tt>compare_strong_order_fallback</tt> denotes a customization point object (16.3.3.3.6 [customization.point.object]). 
Given subexpressions <tt>E</tt> and <tt>F</tt>, the expression <tt>compare_strong_order_fallback(E, F)</tt> is 
expression-equivalent (3.21 [defns.expression-equivalent]) to:
</p>
<ol style="list-style-type: none">
<li><p>[&hellip;]</p></li>
<li><p>(4.3) &mdash; Otherwise, if the expressions <tt>E == F</tt> and <tt>E &lt; F</tt> are both well-formed and 
<del>convertible to <tt>bool</tt></del><ins>the types <tt>decltype(E == F)</tt> and <tt>decltype(E &lt; F)</tt> 
both model <tt><i>boolean-testable</i></tt></ins>,</p>
<blockquote><pre>
E == F ? strong_ordering::equal :
E &lt; F  ? strong_ordering::less :
         strong_ordering::greater
</pre></blockquote>
<p>
except that <tt>E</tt> and <tt>F</tt> are evaluated only once.
</p>
</li>
<li><p>[&hellip;]</p></li>
</ol>
<p>
[&hellip;]
<p/>
-5- The name <tt>compare_weak_order_fallback</tt> denotes a customization point object (16.3.3.3.6 [customization.point.object]). 
Given subexpressions <tt>E</tt> and <tt>F</tt>, the expression <tt>compare_weak_order_fallback(E, F)</tt> is 
expression-equivalent (3.21 [defns.expression-equivalent]) to:
</p>
<ol style="list-style-type: none">
<li><p>[&hellip;]</p></li>
<li><p>(5.3) &mdash; Otherwise, if the expressions <tt>E == F</tt> and <tt>E &lt; F</tt> are both well-formed and 
<del>convertible to <tt>bool</tt></del><ins>the types <tt>decltype(E == F)</tt> and <tt>decltype(E &lt; F)</tt> 
both model <tt><i>boolean-testable</i></tt></ins>,</p>
<blockquote><pre>
E == F ? weak_ordering::equivalent :
E &lt; F  ? weak_ordering::less :
         weak_ordering::greater
</pre></blockquote>
<p>
except that <tt>E</tt> and <tt>F</tt> are evaluated only once.
</p>
</li>
<li><p>[&hellip;]</p></li>
</ol>
<p>
[&hellip;]
<p/>
-6- The name <tt>compare_partial_order_fallback</tt> denotes a customization point object (16.3.3.3.6 [customization.point.object]). 
Given subexpressions <tt>E</tt> and <tt>F</tt>, the expression <tt>compare_partial_order_fallback(E, F)</tt> is 
expression-equivalent (3.21 [defns.expression-equivalent]) to:
</p>
<ol style="list-style-type: none">
<li><p>[&hellip;]</p></li>
<li><p>(6.3) &mdash; Otherwise, if the expressions <tt>E == F</tt> and <tt>E &lt; F</tt> are both well-formed and 
<del>convertible to <tt>bool</tt></del><ins>the types <tt>decltype(E == F)</tt> and <tt>decltype(E &lt; F)</tt> 
both model <tt><i>boolean-testable</i></tt></ins>,</p>
<blockquote><pre>
E == F ? partial_ordering::equivalent :
E &lt; F  ? partial_ordering::less :
E &gt; F  ? partial_ordering::greater :
         partial_ordering::unordered
</pre></blockquote>
<p>
except that <tt>E</tt> and <tt>F</tt> are evaluated only once.
</p>
</li>
<li><p>[&hellip;]</p></li>
</ol>
</blockquote>

</li>

<li><p>Change 20.5.8 [tuple.rel] as indicated:</p>

<blockquote><pre>
template&lt;class... TTypes, class... UTypes&gt;
  constexpr bool operator==(const tuple&lt;TTypes...&gt;&amp; t, const tuple&lt;UTypes...&gt;&amp; u);
</pre>
<blockquote>
<p>
-1- <i>Mandates:</i> For all <tt>i</tt>, where <tt>0 &le; i &lt; sizeof...(TTypes)</tt>, 
<tt>get&lt;i&gt;(t) == get&lt;i&gt;(u)</tt> is a valid expression <del>returning a type that 
is convertible to <tt>bool</tt></del><ins>and the type <tt>decltype(get&lt;i&gt;(t) == get&lt;i&gt;(u))</tt> 
models <tt><i>boolean-testable</i></tt></ins>. <tt>sizeof...(TTypes)</tt> equals <tt>sizeof...(UTypes)</tt>.
</p>
</blockquote>
</blockquote>

</li>

<li><p>Keep 20.6.6 [optional.relops] unchanged: These operations just evaluate what they get and say, and no further 
requirements are imposed.</p>
</li>

<li><p>Keep 20.6.8 [optional.comp.with.t] unchanged: These operations just evaluate what they get and say, and no further 
requirements are imposed.</p>
</li>

<li><p>Keep 20.7.6 [variant.relops] unchanged: These operations just evaluate what they get and say, and no further 
requirements are imposed.</p>
</li>

<li><p>Keep 20.15.8 [meta.logical] unchanged: These logical type traits do already the boolean logic for you, and 
no further requirements are imposed.</p>
</li>

<li><p>Change Table [tab:container.req] as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> Given that the containers are no user-provided types it seems like an unnecessary 
generic allowance to support types that are convertible to <tt>bool</tt> below. In particular, because the
container requirements tables would then be in (weak) conflict with the header and class synopses of the 
corresponding containers, which all specify concrete <tt>bool</tt> for these operations. 
<p/>
For this specific wording change here, the author has a mild preference to get rid of the "convertibility"
freedom. The alternative would be declare these types as "modeling <tt><i>boolean-testable</i></tt>".]
</p>
</blockquote>

<blockquote>

<table border="1">
<caption>Table 73: Container requirements [tab:container.req]</caption>

<tr>
<th>Expression</th>
<th>Return type</th>
<th>Operational<br/>semantics</th>
<th>Assertion/note<br/>pre-/post-condition</th>
<th>Complexity</th>
</tr>

<tr>
<td colspan="5" style="text-align:center;">&hellip;</td> 
</tr>

<tr>
<td><tt>a == b</tt></td>
<td><tt><del>convertible to</del> <tt>bool</tt></tt></td>
<td><tt>==</tt> is an equivalence relation.<br/>
<tt>equal(a.begin(), a.end(),<br/>
b.begin(), b.end())</tt></td>
<td>[&hellip;]</td>
<td>[&hellip;]</td>
</tr>

<tr>
<td><tt>a != b</tt></td>
<td><tt><del>convertible to</del> <tt>bool</tt></tt></td>
<td>Equivalent to <tt>!(a == b)</tt></td>
<td>[&hellip;]</td>
<td>[&hellip;]</td>
</tr>

<tr>
<td colspan="5" style="text-align:center;">&hellip;</td> 
</tr>

<tr>
<td><tt>a.empty()</tt></td>
<td><tt><del>convertible to</del> <tt>bool</tt></tt></td>
<td><tt>a.begin() == a.end()</tt></td>
<td>[&hellip;]</td>
<td>[&hellip;]</td>
</tr>

</table>
</blockquote>
</li>

<li><p>Keep 23.3.4.4 [iterator.concept.winc] unchanged: It seems to me that sufficient wording exists to exclude
funny integer-class types, and they are all under control by the implementation.</p>
</li>

<li><p>Change in [iterator.cpp17] Table [tab:inputiterator] and Table [tab:randomaccessiterator] as indicated:</p>

<blockquote>

<table border="1">
<caption>Table 85: <i>Cpp17InputIterator</i> requirements (in addition to <i>Cpp17Iterator</i>) [tab:inputiterator]</caption>

<tr>
<th>Expression</th>
<th>Return type</th>
<th>Operational<br/>semantics</th>
<th>Assertion/note<br/>pre-/post-condition</th>
</tr>

<tr>
<td><tt>a != b</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a != b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>!(a == b)</tt></td>
<td>[&hellip;]</td>
</tr>

<tr>
<td colspan="4" style="text-align:center;">&hellip;</td> 
</tr>

</table>
<p>
[&hellip;]
</p>
<table border="1">
<caption>Table 89: <i>Cpp17RandomAccessIterator</i> requirements (in addition to <i>Cpp17BidirectionalIterator</i>)
[tab:randomaccessiterator]</caption>

<tr>
<th>Expression</th>
<th>Return type</th>
<th>Operational<br/>semantics</th>
<th>Assertion/note<br/>pre-/post-condition</th>
</tr>

<tr>
<td colspan="4" style="text-align:center;">&hellip;</td> 
</tr>

<tr>
<td><tt>a &lt; b</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a &lt; b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><i>Effects:</i> Equivalent to: <tt>return<br/>b - a &gt; 0;</tt></td>
<td>[&hellip;]</td>
</tr>

<tr>
<td><tt>a &gt; b</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a &gt; b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>b &lt; a</tt></td>
<td>[&hellip;]</td>
</tr>

<tr>
<td><tt>a &gt;= b</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a &gt;= b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>!(a &lt; b)</tt></td>
<td>[&hellip;]</td>
</tr>

<tr>
<td><tt>a &lt;= b</tt></td>
<td><del>contextually convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(a &lt;= b)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>!(a &gt; b)</tt></td>
<td>[&hellip;]</td>
</tr>

</table>
</blockquote>
</li>

<li><p>Keep 23.5.1.8 [reverse.iter.cmp] unchanged: These operations just evaluate what they get and say, and no further 
requirements are imposed.</p>
</li>

<li><p>Keep 23.5.3.8 [move.iter.op.comp] unchanged: These operations just evaluate what they get and say, and no further 
requirements are imposed.</p>
</li>

<li><p>Change 25.2 [algorithms.requirements] as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> The wording changes below also fix (a) unusual wording forms used ("should work") which are unclear 
in which sense they are imposing normative requirements and (b) the problem, that the current wording seems to allow 
that the predicate may mutate a call argument, if that is not a dereferenced iterator. Upon applying the new wording 
it became obvious that the both the previous and the new wording has the effect that currently algorithms such as 
<tt>adjacent_find</tt>, <tt>search_n</tt>, <tt>unique</tt>, and <tt>unique_copy</tt> are not correctly described 
(because they have no iterator argument named <tt>first1</tt>), which could give raise to a new library issue. ]
</p>
</blockquote>

<blockquote>
<p>
-7- When not otherwise constrained, the <tt>Predicate</tt> parameter is used whenever an algorithm expects a function
object (20.14 [function.objects]) that, when applied to the result of dereferencing the corresponding iterator, 
returns a value testable as <tt>true</tt>. I<del>n other words, i</del>f an algorithm takes <tt>Predicate pred</tt> as its 
argument and <tt>first</tt> as its iterator argument with value type <tt>T</tt>, <del>it should work correctly in the 
construct <tt>pred(*first)</tt> contextually converted to <tt>bool</tt> (7.3 [conv])</del><ins>the expression
<tt>pred(*first)</tt> shall be well-formed and the type <tt>decltype(pred(*first))</tt> shall model 
<tt><i>boolean-testable</i></tt> (18.5.2 [concept.booleantestable])</ins>. 
The function object <tt>pred</tt> shall not apply any non-constant function through <del>the dereferenced 
iterator</del><ins>its argument</ins>. Given a glvalue <tt>u</tt> of type (possibly <tt>const</tt>) <tt>T</tt> that 
designates the same object as <tt>*first</tt>, <tt>pred(u)</tt> shall be a valid expression that is equal to <tt>pred(*first)</tt>.
<p/>
-8- When not otherwise constrained, the <tt>BinaryPredicate</tt> parameter is used whenever an algorithm expects a
function object that when applied to the result of dereferencing two corresponding iterators or to dereferencing
an iterator and type <tt>T</tt> when <tt>T</tt> is part of the signature returns a value testable as <tt>true</tt>. 
I<del>n other words, i</del>f an algorithm takes <tt>BinaryPredicate binary_pred</tt> as its argument and <tt>first1</tt> 
and <tt>first2</tt> as its iterator arguments with respective value types <tt>T1</tt> and <tt>T2</tt>, <del>it should 
work correctly in the construct <tt>binary_pred(*first1, *first2)</tt> contextually converted to <tt>bool</tt> 
(7.3 [conv])</del><ins>the expression <tt>binary_pred(*first1, *first2)</tt> shall be well-formed and the type 
<tt>decltype(binary_pred(*first1, *first2))</tt> shall model <tt><i>boolean-testable</i></tt></ins>. Unless otherwise specified, <tt>BinaryPredicate</tt> always takes the 
first iterator's <tt>value_type</tt> as its first argument, that is, in those cases when <tt>T value</tt> is part 
of the signature, <del>it should work correctly in the construct <tt>binary_pred(*first1, value)</tt> contextually 
converted to <tt>bool</tt> (7.3 [conv])</del><ins>the expression <tt>binary_pred(*first1, value)</tt> shall be 
well-formed and the type <tt>decltype(binary_pred(*first1, value))</tt> shall model <tt><i>boolean-testable</i></tt></ins>. 
<tt>binary_pred</tt> shall not apply any non-constant function through <del>the dereferenced iterators</del><ins>any 
of its arguments</ins>. Given a glvalue <tt>u</tt> of type (possibly <tt>const</tt>) <tt>T1</tt> that designates 
the same object as <tt>*first1</tt>, and a glvalue v of type (possibly <tt>const</tt>) <tt>T2</tt> that designates 
the same object as <tt>*first2</tt>, <tt>binary_pred(u, *first2)</tt>, <tt>binary_pred(*first1, v)</tt>, and 
<tt>binary_pred(u, v)</tt> shall each be a valid expression that is equal to <tt>binary_pred(*first1, *first2)</tt>, 
and <tt>binary_pred(u, value)</tt> shall be a valid expression that is equal to <tt>binary_pred(*first1, value)</tt>.
</p>

</blockquote>
</li>

<li><p>Change 25.8.1 [alg.sorting.general] as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> The existing wording inherits all the good wording from <tt>BinaryPredicate</tt>,
that we fixed above, so there is only little to do but specifying the conversion to <tt>bool</tt> less strict,
since we already know that it is a type that models <tt><i>boolean-testable</i></tt>]
</p>
</blockquote>

<blockquote>
<p>
-2- <tt>Compare</tt> is a function object type (20.14 [function.objects]) that meets the requirements for 
a template parameter named <tt>BinaryPredicate</tt> (25.2 [algorithms.requirements]). The return value 
of the function call operation applied to an object of type <tt>Compare</tt>, when <del>contextually</del> converted 
to <tt>bool</tt> <del>(7.3 [conv])</del>, yields <tt>true</tt> if the first argument of the call is less than the second,
and <tt>false</tt> otherwise. <tt>Compare comp</tt> is used throughout for algorithms assuming an ordering relation.
</p>

</blockquote>
</li>

<li><p>Change in 29.5.4.2 [fpos.operations] Table [tab:fpos.operations] as indicated:</p>

<blockquote>

<table border="1">
<caption>Table 121: Position type requirements [tab:fpos.operations]</caption>

<tr>
<th>Expression</th>
<th>Return type</th>
<th>Operational<br/>semantics</th>
<th>Assertion/note<br/>pre-/post-condition</th>
</tr>

<tr>
<td colspan="4" style="text-align:center;">&hellip;</td> 
</tr>

<tr>
<td><tt>p != q</tt></td>
<td><del>convertible to <tt>bool</tt></del><br/>
<ins><tt>decltype(p != q)</tt></ins><br/>
<ins>models <tt><i>boolean-testable</i></tt></ins></td>
<td><tt>!(p == q)</tt></td>
<td></td>
</tr>

<tr>
<td colspan="4" style="text-align:center;">&hellip;</td> 
</tr>

</table>
</blockquote>
</li>

<li><p>Change 32.2.1 [thread.req.paramname] as indicated:</p>

<blockquote class="note">
<p>
[<i>Drafting note:</i> The following performs some minor drive-by fixes to fix minor wording issues
that would e.g. exclude normal function pointers to be used as predicate. Note that we intentionally
do <em>not</em> describe a <tt>const</tt> lvalue <tt>pred</tt>, since there is nothing in the specification
that would imply or require that.]
</p>
</blockquote>

<blockquote>
<p>
-1- Throughout this Clause, the names of template parameters are used to express type requirements. <del>If a
template parameter is named <tt>Predicate</tt>, <tt>operator()</tt> applied to the template argument 
shall return a value that is convertible to <tt>bool</tt></del><ins><tt>Predicate</tt> is a function object type 
(20.14 [function.objects]). Let <tt>pred</tt> denote an lvalue of type <tt>Predicate</tt>. Then the
expression <tt>pred()</tt> shall be well-formed and the type <tt>decltype(pred())</tt> shall model 
<tt><i>boolean-testable</i></tt> (18.5.2 [concept.booleantestable]). 
The return value of <tt>pred()</tt>, converted to <tt>bool</tt>, yields <tt>true</tt> if the corresponding 
test condition is satisfied, and <tt>false</tt> otherwise</ins>. [&hellip;]
</p>

</blockquote>
</li>
</ol>

<h2><a name="Akn"></a>Acknowledgements</h2>
<p>
Thanks to Barry Revzin, Tim Song, and Tomasz Kami&nacute;ski for reviewing this proposal and providing helpful 
improvement suggestions.
</p>

<h2><a name="Bibliography"></a>Bibliography</h2>

<div id="refs">
<div id="ref-N4892">
<p>
[N4892] Thomas K&umlo;ppe: "Working Draft, Standard for Programming Language C++", 2021<br/>
<a href="https://wg21.link/n4892">https://wg21.link/n4892</a>
</p>
</div>

<div id="ref-P1964R2">
<p>
[P1964R2] Tim Song: "Wording for <i>boolean-testable</i>", 2020<br/>
<a href="https://wg21.link/p1964r2">https://wg21.link/p1964r2</a>
</p>
</div>

<div id="ref-LWG-2114">
<p>
[LWG2114] Daniel Kr&uuml;gler: "Incorrect "<i>contextually</i> convertible to <tt>bool</tt>" requirements", 2011<br/>
<a href="https://wg21.link/lwg2114">https://wg21.link/lwg2114</a>
</p>
</div>
</div>

</body></html>