<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2387: More nested types that must be accessible and unambiguous</title>
<meta property="og:title" content="Issue 2387: More nested types that must be accessible and unambiguous">
<meta property="og:description" content="C++ library issue. Status: C++17">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2387.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="2387"><a href="lwg-defects.html#2387">2387</a>. More nested types that must be accessible and unambiguous</h3>
<p><b>Section:</b> 22.10.4 <a href="https://wg21.link/func.require">[func.require]</a>, 22.10.6 <a href="https://wg21.link/refwrap">[refwrap]</a> <b>Status:</b> <a href="lwg-active.html#C++17">C++17</a>
 <b>Submitter:</b> Jonathan Wakely <b>Opened:</b> 2014-05-23 <b>Last modified:</b> 2017-07-30</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View other</b> <a href="lwg-index-open.html#func.require">active issues</a> in [func.require].</p>
<p><b>View all other</b> <a href="lwg-index.html#func.require">issues</a> in [func.require].</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>
Further to <a href="lwg-defects.html#2299" title="[CD] Effects of inaccessible key_compare::is_transparent type are not clear (Status: C++14)">2299</a><sup><a href="https://cplusplus.github.io/LWG/issue2299" title="Latest snapshot">(i)</a></sup> and <a href="lwg-defects.html#2361" title="Apply 2299 resolution throughout library (Status: C++17)">2361</a><sup><a href="https://cplusplus.github.io/LWG/issue2361" title="Latest snapshot">(i)</a></sup>, 22.10.4 <a href="https://wg21.link/func.require">[func.require]</a> p3 and 22.10.6 <a href="https://wg21.link/refwrap">[refwrap]</a> p3 and p4
talk about member types without any mention of being accessible and unambiguous.
</p>

<p><i>[2014-06-05 Daniel provides wording]</i></p>


<p><i>[2014-06-06 Library reflector vote]</i></p>

<p>
The issue has been identified as Tentatively Ready based on six votes in favour.
</p>



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

<ol>
<li><p>Change 22.10.4 <a href="https://wg21.link/func.require">[func.require]</a> p3 as indicated:</p>

<blockquote><p>
-3- If a call wrapper (20.9.1) has a <i>weak result type</i> the type of its member type <code>result_type</code> is based on the
type <code>T</code> of the wrapper's target object (20.9.1):
</p>
<ul>
<li><p>if <code>T</code> is a pointer to function type, <code>result_type</code> shall be a synonym for the return type of <code>T</code>;</p></li>
<li><p>if <code>T</code> is a pointer to member function, <code>result_type</code> shall be a synonym for the return type of <code>T</code>;</p></li>
<li><p>if <code>T</code> is a class type <ins>and the qualified-id <code>T::result_type</code> is valid and denotes a type 
(13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins><del>with a member type <code>result_type</code></del>, then <code>result_type</code> shall be a synonym for
<code>T::result_type</code>;</p></li> 
<li><p>otherwise <code>result_type</code> shall not be defined.</p></li>
</ul>
</blockquote>
</li>

<li><p>Change 22.10.6 <a href="https://wg21.link/refwrap">[refwrap]</a> p3+p4 as indicated:</p>

<blockquote>
<p>
-3- The template instantiation <code>reference_wrapper&lt;T&gt;</code> shall define a nested type named <code>argument_type</code> as a
synonym for <code>T1</code> only if the type <code>T</code> is any of the following:
</p>
<ul>
<li><p>a function type or a pointer to function type taking one argument of type <code>T1</code></p></li>
<li><p>a pointer to member function <code>R T0::f</code> <i>cv</i> (where  <i>cv</i> represents the member function_s cv-qualifiers);
the type <code>T1</code> is <i>cv</i> <code>T0*</code></p></li> 
<li><p>a class type <ins>where the qualified-id <code>T::argument_type</code> is valid and denotes a type 
(13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins><del>with a member type <code>argument_type</code></del>; the type <code>T1</code> is 
<code>T::argument_type</code>.</p></li>
</ul>
<p>
-4- The template instantiation <code>reference_wrapper&lt;T&gt;</code> shall define two nested types named <code>first_argument_type</code> 
and <code>second_argument_type</code> as synonyms for <code>T1</code> and <code>T2</code>, respectively, only if the type <code>T</code> is any of the
following:
</p>
<ul>
<li><p>a function type or a pointer to function type taking two arguments of types <code>T1</code> and <code>T2</code></p></li>
<li><p>a pointer to member function <code>R T0::f(T2)</code> <i>cv</i> (where <i>cv</i> represents the member function's cv-qualifiers);
the type <code>T1</code> is <i>cv</i> <code>T0*</code></p></li> 
<li><p>a class type <ins>where the qualified-ids <code>T::first_argument_type</code> and <code>T::second_argument_type</code> are both valid 
and both denote types (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins><del>with member types <code>first_argument_type</code> and 
<code>second_argument_type</code></del>; the type <code>T1</code> is <code>T::first_argument_type</code><del>.</del> and the type <code>T2</code> is 
<code>T::second_argument_type</code>.</p></li>
</ul>
</blockquote>

</li>
</ol>





</body>
</html>
