<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 1074: concept map broken by N2840</title>
<meta property="og:title" content="Issue 1074: concept map broken by N2840">
<meta property="og:description" content="C++ library issue. Status: NAD Concepts">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue1074.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#NAD_Concepts">NAD Concepts</a> status.</em></p>
<h3 id="1074"><a href="lwg-closed.html#1074">1074</a>. concept map broken by N2840</h3>
<p><b>Section:</b> 99 [allocator.element.concepts] <b>Status:</b> <a href="lwg-active.html#NAD_Concepts">NAD Concepts</a>
 <b>Submitter:</b> Alisdair Meredith <b>Opened:</b> 2009-03-19 <b>Last modified:</b> 2016-01-28</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all issues with</b> <a href="lwg-status.html#NAD Concepts">NAD Concepts</a> status.</p>
<p><b>Discussion:</b></p>

<p>
p7 Allocator-related element concepts 99 [allocator.element.concepts]
</p>

<p>
The changes to the <code>AllocatableElement</code> concept mean this <code>concept_map</code>
specialization no longer matches the original concept:
</p>

<blockquote><pre>
template &lt;Allocator Alloc, class T, class ... Args&gt;
  requires HasConstructor&lt;T, Args...&gt;
    concept_map AllocatableElement&lt;Alloc, T, Args&amp;&amp;...&gt; {
      void construct_element(Alloc&amp; a, T* t, Args&amp;&amp;... args) {
        Alloc::rebind&lt;T&gt;(a).construct(t, forward(args)...);
      }
    }
</pre></blockquote>

<p><i>[
2009-03-23 Pablo adds:
]</i></p>


<blockquote><p>
Actually, this is incorrect,
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2840.pdf">N2840</a>
says. "In section 
99 [allocator.element.concepts] paragraph 8, modify the definition of the
<code>AllocatableElement</code> concept and eliminate the related concept map:" but
then neglects to include the red-lined text of the concept map that was
to be eliminated. Pete also missed this, but I caught it he asked me to
review his edits.  Pete's updated WP removes the concept map entirely,
which was the original intent.  The issue is, therefore, moot.  Note, as
per my presentation of
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2840.pdf">N2840</a>
in summit, <code>construct()</code> no longer has a
default implementation.  This regrettable fact was deemed (by David
Abrahams, Doug, and myself) to be preferable to the complexity of
providing a default implementation that would not under-constrain a more
restrictive allocator (like the scoped allocators).
</p></blockquote>

<p><i>[
2009-05-01 Daniel adds:
]</i></p>

<blockquote>
<p>
it seems to me that #1074 should be resolved as a NAD, because the
current WP has already removed the previous AllocatableElement concept map.
It introduced auto concept AllocatableElement instead, but as of
99 [allocator.element.concepts]/7 this guy contains now
</p>
<blockquote><pre>
requires FreeStoreAllocatable&lt;T&gt;;
void Alloc::construct(T*, Args&amp;&amp;...);
</pre></blockquote>
</blockquote>

<p><i>[
Batavia (2009-05):
]</i></p>

<blockquote>
<p>
The affected code is no longer part of the Working Draft.
</p>
<p>
Move to NAD.
</p>
</blockquote>


<p id="res-1074"><b>Proposed resolution:</b></p>
<p>
Change 99 [allocator.element.concepts]:
</p>

<blockquote><pre>
template &lt;Allocator Alloc, class T, class ... Args&gt;
  requires HasConstructor&lt;T, Args...&gt;
    concept_map AllocatableElement&lt;Alloc, T, Args&amp;&amp;...&gt; {
      void construct_element(<del>Alloc&amp; a,</del> T* t, Args&amp;&amp;... args) {
        Alloc::rebind&lt;T&gt;(a).construct(t, forward(args)...);
      }
    }
</pre></blockquote>






</body>
</html>
