<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2361: Apply 2299 resolution throughout library</title>
<meta property="og:title" content="Issue 2361: Apply 2299 resolution throughout library">
<meta property="og:description" content="C++ library issue. Status: C++17">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2361.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="2361"><a href="lwg-defects.html#2361">2361</a>. Apply 2299 resolution throughout library</h3>
<p><b>Section:</b> 20.3.1.3 <a href="https://wg21.link/unique.ptr.single">[unique.ptr.single]</a>, 20.2.3.2 <a href="https://wg21.link/pointer.traits.types">[pointer.traits.types]</a>, 20.2.8.1 <a href="https://wg21.link/allocator.uses.trait">[allocator.uses.trait]</a>, 20.2.9.2 <a href="https://wg21.link/allocator.traits.types">[allocator.traits.types]</a>, 23.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a> <b>Status:</b> <a href="lwg-active.html#C++17">C++17</a>
 <b>Submitter:</b> Jonathan Wakely <b>Opened:</b> 2014-02-14 <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#unique.ptr.single">active issues</a> in [unique.ptr.single].</p>
<p><b>View all other</b> <a href="lwg-index.html#unique.ptr.single">issues</a> in [unique.ptr.single].</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>
LWG <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> addressed a N.B. comment pointing out that recently added
wording about a type existing was not clear what happens if the type
exists but is inaccessible. There are 16 pre-existing uses of the same
language in the library that should use the same wording used to
resolve 2299.
</p>

<p>
The relevant paragraphs are:
</p>

<p>
20.3.1.3 <a href="https://wg21.link/unique.ptr.single">[unique.ptr.single]</a>
<p/>
20.2.3.2 <a href="https://wg21.link/pointer.traits.types">[pointer.traits.types]</a>
<p/>
20.2.8.1 <a href="https://wg21.link/allocator.uses.trait">[allocator.uses.trait]</a>
<p/>
20.2.9.2 <a href="https://wg21.link/allocator.traits.types">[allocator.traits.types]</a>
<p/>
23.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a>
</p>

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


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

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



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

<ol>
<li><p>Change 20.2.3.2 <a href="https://wg21.link/pointer.traits.types">[pointer.traits.types]</a> as indicated:</p>

<blockquote>
<pre>
typedef <i>see below</i> element_type;
</pre>
<blockquote>
<p>
-1- <i>Type</i>: <code>Ptr::element_type</code> if <del>such a type exists</del><ins>the qualified-id <code>Ptr::element_type</code> is
valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, <code>T</code> if <code>Ptr</code> is a class template instantiation
of the form <code>SomePointer&lt;T, Args&gt;</code>, where <code>Args</code> is zero or more type arguments; otherwise, the
specialization is ill-formed.
</p>
</blockquote>

<pre>
typedef <i>see below</i> difference_type;
</pre>
<blockquote>
<p>
-2- <i>Type</i>: <code>Ptr::difference_type</code> if <del>such a type exists</del><ins>the qualified-id <code>Ptr::difference_type</code> is
valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, <code>std::ptrdiff_t</code>.
</p>
</blockquote>

<pre>
template &lt;class U&gt; using rebind = <i>see below</i>;
</pre>
<blockquote>
<p>
-3- <i>Alias template</i>: <code>Ptr::rebind&lt;U&gt;</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Ptr::rebind&lt;U&gt;</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>SomePointer&lt;U, Args&gt;</code> if <code>Ptr</code> is a class template instantiation of the form <code>SomePointer&lt;T, Args&gt;</code>, 
where <code>Args</code> is zero or more type arguments; otherwise, the instantiation of <code>rebind</code> is ill-formed.
</p>
</blockquote>
</blockquote>
</li>

<li><p>Change 20.2.8.1 <a href="https://wg21.link/allocator.uses.trait">[allocator.uses.trait]</a> p1 as indicated:</p>

<blockquote>
<pre>
template &lt;class T, class Alloc&gt; struct uses_allocator;
</pre>
<blockquote>
<p>
-1- <i>Remark<ins>s</ins></i>: automatically detects whether <code>T</code> has a nested <code>allocator_type</code> that is 
convertible from <code>Alloc</code>. Meets the <code>BinaryTypeTrait</code> requirements (20.10.1). The implementation shall provide a definition
that is derived from <code>true_type</code> if <del>a type</del><ins>the qualified-id</ins> <code>T::allocator_type</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> and <code>is_convertible&lt;Alloc, T::allocator_type&gt;::value != false</code>, 
otherwise it shall be derived from <code>false_type</code>. [&hellip;]
</p>
</blockquote>
</blockquote>
</li>

<li><p>Change 20.2.9.2 <a href="https://wg21.link/allocator.traits.types">[allocator.traits.types]</a> as indicated:</p>

<blockquote>
<pre>
typedef <i>see below</i> pointer;
</pre>
<blockquote>
<p>
-1- <i>Type</i>: <code>Alloc::pointer</code> if <del>such a type exists</del><ins>the qualified-id <code>Alloc::pointer</code> is
valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, <code>value_type*</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> const_pointer;
</pre>
<blockquote>
<p>
-2- <i>Type</i>: <code>Alloc::const_pointer</code> if <del>such a type exists</del><ins>the qualified-id <code>Alloc::const_pointer</code> is
valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>pointer_traits&lt;pointer&gt;::rebind&lt;const value_type&gt;</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> void_pointer;
</pre>
<blockquote>
<p>
-3- <i>Type</i>: <code>Alloc::void_pointer</code> if <del>such a type exists</del><ins>the qualified-id <code>Alloc::void_pointer</code> is
valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>pointer_traits&lt;pointer&gt;::rebind&lt;void&gt;</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> const_void_pointer;
</pre>
<blockquote>
<p>
-4- <i>Type</i>: <code>Alloc::const_void_pointer</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Alloc::const_void_pointer</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>pointer_traits&lt;pointer&gt;::rebind&lt;const void&gt;</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> difference_type;
</pre>
<blockquote>
<p>
-5- <i>Type</i>: <code>Alloc::difference_type</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Alloc::difference_type</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>pointer_traits&lt;pointer&gt;::difference_type</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> size_type;
</pre>
<blockquote>
<p>
-6- <i>Type</i>: <code>Alloc::size_type</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Alloc::size_type</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>make_unsigned_t&lt;difference_type&gt;</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> propagate_on_container_copy_assignment;
</pre>
<blockquote>
<p>
-7- <i>Type</i>: <code>Alloc::propagate_on_container_copy_assignment</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Alloc::propagate_on_container_copy_assignment</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>false_type</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> propagate_on_container_move_assignment;
</pre>
<blockquote>
<p>
-8- <i>Type</i>: <code>Alloc::propagate_on_container_move_assignment</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Alloc::propagate_on_container_move_assignment</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>false_type</code>.
</p>
</blockquote>

<pre>
typedef <i>see below</i> propagate_on_container_swap;
</pre>
<blockquote>
<p>
-9- <i>Type</i>: <code>Alloc::propagate_on_container_swap</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Alloc::propagate_on_container_swap</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>false_type</code>.
</p>
</blockquote>

<pre>
template &lt;class T&gt; using rebind_alloc = <i>see below</i>;
</pre>
<blockquote>
<p>
-10- <i>Alias template</i>: <code>Alloc::rebind&lt;T&gt;::other</code> if <del>such a type exists</del><ins>the qualified-id 
<code>Alloc::rebind&lt;T&gt;::other</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins>; otherwise, 
<code>Alloc&lt;T, Args&gt;</code> if <code>Alloc</code> is a class template instantiation of the form <code>Alloc&lt;U, Args&gt;</code>, 
where <code>Args</code> is zero or more type arguments; otherwise, the instantiation of <code>rebind_alloc</code> is ill-formed.
</p>
</blockquote>
</blockquote>
</li>

<li><p>Change 20.3.1.3 <a href="https://wg21.link/unique.ptr.single">[unique.ptr.single]</a> p3 as indicated:</p>

<blockquote><p>
-3- If the <del>type</del><ins>qualified-id</ins> <code>remove_reference_t&lt;D&gt;::pointer</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>, then <code>unique_ptr&lt;T, D&gt;::pointer</code> shall be a synonym
for <code>remove_reference_t&lt;D&gt;::pointer</code>. [&hellip;]
</p></blockquote>
</li>

<li><p>Change 23.2.4 <a href="https://wg21.link/sequence.reqmts">[sequence.reqmts]</a> p3 as indicated:</p>

<blockquote><p>
-3- In Tables 100 and 101, <code>X</code> denotes a sequence container class, <code>a</code> denotes a value of <code>X</code> containing elements
of type <code>T</code>, <code>A</code> denotes <code>X::allocator_type</code> if <del>it exists</del><ins>the qualified-id 
<code>X::allocator_type</code> is valid and denotes a type (13.10.3 <a href="https://wg21.link/temp.deduct">[temp.deduct]</a>)</ins> and <code>std::allocator&lt;T&gt;</code> 
if it doesn't, [&hellip;]
</p></blockquote>
</li>


</ol>






</body>
</html>
