<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3681: Further considerations on LWG 3679</title>
<meta property="og:title" content="Issue 3681: Further considerations on LWG 3679">
<meta property="og:description" content="C++ library issue. Status: New">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3681.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#New">New</a> status.</em></p>
<h3 id="3681"><a href="lwg-active.html#3681">3681</a>. Further considerations on LWG 3679</h3>
<p><b>Section:</b> 20.5.1 <a href="https://wg21.link/mem.res.syn">[mem.res.syn]</a>, 20.2.2 <a href="https://wg21.link/memory.syn">[memory.syn]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
 <b>Submitter:</b> Jiang An <b>Opened:</b> 2022-02-28 <b>Last modified:</b> 2022-05-17</p>
<p><b>Priority: </b>4
</p>
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
<p><b>Discussion:</b></p>
<p>
The issue reflected in LWG <a href="lwg-active.html#3679" title="Is &lt;ranges&gt; sufficient for istream_view? (Status: LEWG)">3679</a><sup><a href="https://cplusplus.github.io/LWG/issue3679" title="Latest snapshot">(i)</a></sup> is not limited to <code>&lt;ranges&gt;</code> and 
<code>std::ranges::istream_view</code>.
<p/>
Example:
</p>
<blockquote><pre>
 #include &lt;vector&gt;
// some standard headers other than &lt;memory&gt; and &lt;memory_resource&gt;

template&lt;class T&gt; my_ator {/*definition, meeting the requirements of <i>Cpp17Allocator</i>*/};

int main()
{
  std::vector&lt;int&gt; v1; // Generally works. Is this guaranteed?
  std::pmr::vector&lt;int&gt; v2; // Usually fails to work on libstdc++. Is this intendedly permitted??
  std::vector&lt;int, my_ator&lt;int&gt;&gt; v3; // Generally works. Is this guaranteed?
}
</pre></blockquote>
<p>
Currently libstdc++ only provides forward declarations of <code>std::pmr::polymorphic_allocator</code> 
in headers of standard allocator-aware containers, which means that users are required to include 
both <code>&lt;memory_resource&gt;</code> and <code>&lt;vector&gt;</code> in order to create a 
<code>std::pmr::vector&lt;T&gt;</code> object. If libstdc++ is technically conforming here, one may say 
the definition of <code>std::allocator</code> is also not guaranteed to be available in these headers, 
so <code>&lt;memory&gt;</code> is required to be included together with such a header to make 
<code><i>standard-container</i>&lt;T&gt;</code> work.
<p/>
Furthermore, the specification of allocator-aware containers are heavily dependent on 
<code>std::allocator_traits</code>. If these containers are not guaranteed to work when the definition of 
<code>std::allocator_traits</code> is not available, and the definition of <code>std::allocator_traits</code> 
is not guaranteed to be provided in headers of these containers, then users are effectively always 
required to include <code>&lt;memory&gt;</code> in order to create a container object, even if they are 
using their own allocators.
</p>

<p><i>[2022-05-17; Reflector poll]</i></p>

<p>
Set priority to 4 after reflector poll.
</p>



<p id="res-3681"><b>Proposed resolution:</b></p>





</body>
</html>
