<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2299: [CD] Effects of inaccessible key_compare::is_transparent type are not clear</title>
<meta property="og:title" content="Issue 2299: [CD] Effects of inaccessible key_compare::is_transparent type are not clear">
<meta property="og:description" content="C++ library issue. Status: C++14">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2299.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++14">C++14</a> status.</em></p>
<h3 id="2299"><a href="lwg-defects.html#2299">2299</a>. [CD] Effects of inaccessible <code>key_compare::is_transparent</code> type are not clear</h3>
<p><b>Section:</b> 23.2.7 <a href="https://wg21.link/associative.reqmts">[associative.reqmts]</a> <b>Status:</b> <a href="lwg-active.html#C++14">C++14</a>
 <b>Submitter:</b> Daniel Kr&uuml;gler <b>Opened:</b> 2013-09-24 <b>Last modified:</b> 2016-01-28</p>
<p><b>Priority: </b>1
</p>
<p><b>View other</b> <a href="lwg-index-open.html#associative.reqmts">active issues</a> in [associative.reqmts].</p>
<p><b>View all other</b> <a href="lwg-index.html#associative.reqmts">issues</a> in [associative.reqmts].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++14">C++14</a> status.</p>
<p><b>Discussion:</b></p>
<p><b>Addresses ES 16</b></p>

<p>
The condition "<code>X::key_compare::is_transparent</code> exists" does not specify that the type be publicly accessible.     
<p/>
Consider the public accessibility of <code>X::key_compare::is_transparent</code> and whether its potential inaccessibility 
should be banned for a compliant <code>key_compare</code> type. 
</p>

<p><i>[2013-09-24 Daniel provides resolution suggestion]</i></p>


<p><i>[2013-09-25 Chicago]</i></p>

<p>
Daniel's wording is good, advance to Immediate to respond to NB comment.
</p>

<p><i>[2013-09-26 Chicago]</i></p>

<p>
Moved back to Review as Daniel would like another look at the words, and to confirm implementability.
</p>

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

<li><p>Change 23.2.7 <a href="https://wg21.link/associative.reqmts">[associative.reqmts]</a> p8 as indicated:</p>

<blockquote><p>
-8- In Table 102, <code>X</code> denotes an associative container class, <code>a</code> denotes a value of <code>X</code>, <code>a_uniq</code> 
denotes a value of <code>X</code> when <code>X</code> supports unique keys, <code>a_eq</code> denotes a value of <code>X</code> when <code>X</code> 
supports multiple keys, <code>a_tran</code> denotes a value of <code>X</code> when <del>the</del><ins>a publicly accessible</ins> type 
<code>X::key_compare::is_transparent</code> exists <ins>whose name is unambiguous and not hidden</ins>, 
[&hellip;]
</p>
</blockquote>
</li>

<li><p>Change 23.2.7 <a href="https://wg21.link/associative.reqmts">[associative.reqmts]</a> p13 as indicated:</p>

<blockquote><p>
The member function templates <code>find</code>, <code>count</code>, <code>lower_bound</code>, <code>upper_bound</code>, and <code>equal_range</code> shall not
participate in overload resolution unless <del>the</del><ins>a publicly accessible</ins> type 
<code>Compare::is_transparent</code> exists <ins>whose name is unambiguous and not hidden</ins>.
</p></blockquote>
</li>
</ol>

</blockquote>

<p><i>[2014-02-10 Daniel comments provides alternative wording]</i></p>


<p>
I could confirm that my previous concerns were unwarranted, because they turned out to be due to a compiler-bug.
Nonetheless I would suggest to replace the previously suggested replication of core-wording situations (access, ambiguity, hidden) 
by a single more robust phrase based on "valid type".
</p>


<p><i>[2014-02-12 Issaquah: Move to Immediate]</i></p>

<p>
STL: This uses &quot;valid type&quot;, which is a Phrase Of Power in Core, and Daniel has a citation for the term.
</p>
<p>
Jonathan: It's nice to rely on Core.
</p>




<p id="res-2299"><b>Proposed resolution:</b></p>
<p>This wording is relative to N3797.</p>

<ol>

<li><p>Change 23.2.7 <a href="https://wg21.link/associative.reqmts">[associative.reqmts]</a> p8 as indicated:</p>

<blockquote><p>
-8- In Table 102, <code>X</code> denotes an associative container class, <code>a</code> denotes a value of <code>X</code>, <code>a_uniq</code> 
denotes a value of <code>X</code> when <code>X</code> supports unique keys, <code>a_eq</code> denotes a value of <code>X</code> when <code>X</code> 
supports multiple keys, <code>a_tran</code> denotes a value of <code>X</code> when the <del>type</del><ins>qualified-id</ins> 
<code>X::key_compare::is_transparent</code> <del>exists</del><ins>is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>, 
[&hellip;]
</p>
</blockquote>
</li>

<li><p>Change 23.2.7 <a href="https://wg21.link/associative.reqmts">[associative.reqmts]</a> p13 as indicated:</p>

<blockquote><p>
The member function templates <code>find</code>, <code>count</code>, <code>lower_bound</code>, <code>upper_bound</code>, and <code>equal_range</code> shall not
participate in overload resolution unless the <del>type</del><ins>qualified-id</ins> 
<code>Compare::is_transparent</code> <del>exists</del><ins>is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>.
</p></blockquote>
</li>
</ol>





</body>
</html>
