<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2569: conjunction and disjunction requirements are too strict</title>
<meta property="og:title" content="Issue 2569: conjunction and disjunction requirements are too strict">
<meta property="og:description" content="C++ library issue. Status: C++17">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2569.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++17">C++17</a> status.</em></p>
<h3 id="2569"><a href="lwg-defects.html#2569">2569</a>. <code>conjunction</code> and <code>disjunction</code> requirements are too strict</h3>
<p><b>Section:</b> 21.3.10 <a href="https://wg21.link/meta.logical">[meta.logical]</a> <b>Status:</b> <a href="lwg-active.html#C++17">C++17</a>
 <b>Submitter:</b> Tim Song <b>Opened:</b> 2015-12-11 <b>Last modified:</b> 2017-12-05</p>
<p><b>Priority: </b>2
</p>
<p><b>View all other</b> <a href="lwg-index.html#meta.logical">issues</a> in [meta.logical].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++17">C++17</a> status.</p>
<p><b>Discussion:</b></p>
<p>
21.3.10 <a href="https://wg21.link/meta.logical">[meta.logical]</a>/2 and /5 impose the following requirement on the arguments of <code>conjunction</code> and <code>disjunction</code>:
</p>
<blockquote><p>
Every template type argument shall be usable as a base class and shall have a static data member value which is convertible to 
<code>bool</code>, is not hidden, and is unambiguously available in the type.
</p></blockquote>
<p>
Since the requirement is unconditional, it applies even to type arguments whose instantiation is not required due to short circuiting. 
This seems contrary to the design intent, expressed in <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0013r1.html">P0013R1</a>, 
that it is valid to write <code>conjunction_v&lt;is_class&lt;T&gt;, is_foo&lt;T&gt;&gt;</code> even if instantiating 
<code>is_foo&lt;T&gt;::value</code> is ill-formed for non-class types.
</p>
<p><i>[2016-08 Chicago]</i></p>

<p>Ville provided wording for both <a href="lwg-defects.html#2569" title="conjunction and disjunction requirements are too strict (Status: C++17)">2569</a><sup><a href="https://cplusplus.github.io/LWG/issue2569" title="Latest snapshot">(i)</a></sup> and <a href="lwg-defects.html#2570" title="[fund.ts.v2] conjunction and disjunction requirements are too strict (Status: TS)">2570</a><sup><a href="https://cplusplus.github.io/LWG/issue2570" title="Latest snapshot">(i)</a></sup>.</p>
<p>Tuesday AM: Move to Tentatively Ready</p>

<p><i>[2016-11-15, Reopen upon request of Dawn Perchik ]</i></p>

<p>
The proposed wording requires an update, because the referenced issue LWG <a href="lwg-defects.html#2568" title="[fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for 
UnaryTypeTraits and BinaryTypeTraits (Status: TS)">2568</a><sup><a href="https://cplusplus.github.io/LWG/issue2568" title="Latest snapshot">(i)</a></sup> is still open.
</p>
<p><i>[Dec 2017 - The resolution for this issue shipped in the C++17 standard; setting status to 'C++17']</i></p>



<p id="res-2569"><b>Proposed resolution:</b></p>
<p><i>[We recommend applying the proposed resolution for LWG issues 2567 and 2568 before this
proposed resolution, lest the poor editor gets confused.]</i></p>


<p>In [meta.logical],</p>

<p>- insert a new paragraph before paragraph 2:</p>

<p><ins>The class template <code>conjunction</code> forms the logical conjunction of its
template type arguments.</ins></p>

<p>- move paragraph 4 before paragraph 2, and edit
paragraph 2 as follows:</p>

<p><del>The class template <code>conjunction</code> forms the logical conjunction of its
template type arguments.</del>
Every template type argument <ins>for which <code>Bi::value</code> is instantiated</ins>
shall be usable as a base class and shall have a member value which is
convertible to <code>bool</code>, is not hidden, and is unambiguously available in the type.</p>

<p>- insert a new paragraph before paragraph 5:</p>

<p><ins>The class template <code>disjunction</code> forms the logical disjunction
of its template type arguments.</ins></p>

<p>- move paragraph 7 before paragraph 5, and edit
paragraph 5 as follows:</p>

<p><del>The class template <code>disjunction</code> forms the logical disjunction
of its template type arguments.</del>
Every template type argument <ins>for which <code>Bi::value</code> is instantiated</ins>
shall be usable as a base class and shall have a member value which is
convertible to <code>bool</code>, is not hidden, and is unambiguously available in the type.</p>





</body>
</html>
