<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2743: p0083r3 node_handle private members missing "exposition only" comment</title>
<meta property="og:title" content="Issue 2743: p0083r3 node_handle private members missing &quot;exposition only&quot; comment">
<meta property="og:description" content="C++ library issue. Status: C++23">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2743.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++23">C++23</a> status.</em></p>
<h3 id="2743"><a href="lwg-defects.html#2743">2743</a>. p0083r3 <code>node_handle</code> private members missing "exposition only" comment</h3>
<p><b>Section:</b> 23.2.5.1 <a href="https://wg21.link/container.node.overview">[container.node.overview]</a> <b>Status:</b> <a href="lwg-active.html#C++23">C++23</a>
 <b>Submitter:</b> Richard Smith <b>Opened:</b> 2016-07-08 <b>Last modified:</b> 2023-11-22</p>
<p><b>Priority: </b>3
</p>
<p><b>View all other</b> <a href="lwg-index.html#container.node.overview">issues</a> in [container.node.overview].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++23">C++23</a> status.</p>
<p><b>Discussion:</b></p>
<p>
The private members of <code>node_handle</code> are missing the usual "exposition only" comment. As a consequence, 
<code>ptr_</code> and <code>alloc_</code> now appear to be names defined by the library (so programs defining these names 
as macros before including a library header have undefined behavior).
<p/>
Presumably this is unintentional and these members should be considered to be for exposition only.
<p/>
It's also not clear whether the name <code>node_handle</code> is reserved for library usage or not; 
23.2.5.1 <a href="https://wg21.link/container.node.overview">[container.node.overview]</a>/3 says the implementation need not provide a type with this name, but 
doesn't seem to rule out the possibility that an implementation will choose to do so regardless.
</p>
<p>
<b>Daniel:</b>
<p/>
A similar problem seems to exist for the exposition-only type <code><i>call_wrapper</i></code> from 
<a href="https://wg21.link/p0358r1">p0358r1</a>, which exposes a private data member named <code>fd</code> and 
a typedef <code>FD</code>.
</p>

<p><i>[2016-07 Chicago]</i></p>

<p>Jonathan says that we need to make clear that the name <code>node_handle</code> is not reserved</p>

<p><i>[2019-03-17; Daniel comments and provides wording]</i></p>

<p>
Due to an editorial step, the previous name <code>node_handle</code>/<code><i>node_handle</i></code> has been replaced 
by the artificial <code><i>node-handle</i></code> name, so I see no longer any reason to talk about a
name <code>node_handle</code> reservation. The provided wording therefore only takes care of the private
members.
</p>

<p><i>[2020-05-16 Reflector discussions]</i></p>

<p>Status to Tentatively Ready after five positive votes on the reflector.</p>
<p><i>[2020-11-09 Approved In November virtual meeting. Status changed: Tentatively Ready &rarr; WP.]</i></p>



<p id="res-2743"><b>Proposed resolution:</b></p>
<p>This wording is relative to <a href="https://wg21.link/n4810">N4810</a>.</p>

<ol>
<li><p>Change 23.2.5.1 <a href="https://wg21.link/container.node.overview">[container.node.overview]</a>, exposition-only class template 
<code><i>node-handle</i></code> synopsis, as indicated:</p>

<blockquote>
<pre>
template&lt;<i>unspecified</i>&gt;
class <i>node-handle</i> {
public:
  [&hellip;]
private:
  using container_node_type = <i>unspecified</i>; <ins><i>// exposition only</i></ins>
  using ator_traits = allocator_traits&lt;allocator_type&gt;; <ins><i>// exposition only</i></ins>
  typename ator_traits::template rebind_traits&lt;container_node_type&gt;::pointer ptr_; <ins><i>// exposition only</i></ins>
  optional&lt;allocator_type&gt; alloc_; <ins><i>// exposition only</i></ins>

public:
  [&hellip;]
};
</pre>
</blockquote>
</li>
</ol>





</body>
</html>
