<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta charset="utf-8">
<title>C++ Standard Library Issues Resolved Directly In Toronto</title>
<style type="text/css">
  p {text-align:justify}
  li {text-align:justify}
  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 {border-collapse: collapse;}
</style>
</head>
<body>
<h1>C++ Standard Library Issues Resolved Directly In Toronto</h1>
<table>
<tr>
<td align="left">Doc. no.</td>
<td align="left">P0699R0</td>
</tr>
<tr>
<td align="left">Date:</td>
<td align="left"><p>Revised 2017-07-14 at 21:21:37 UTC</p>
</td>
</tr>
<tr>
<td align="left">Project:</td>
<td align="left">Programming Language C++</td>
</tr>
<tr>
<td align="left">Reply to:</td>
<td align="left">Marshall Clow &lt;<a href="mailto:lwgchair@gmail.com">lwgchair@gmail.com</a>&gt;</td>
</tr>
</table>
<h2>Immediate Issues</h2>
<hr>
<h3><a name="2901" href="#2901">2901.</a> Variants cannot properly support allocators</h3>
<p><b>Section:</b> 23.7.3 [variant.variant] <b>Status:</b> <a href="lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> United States <b>Opened:</b> 2017-02-03 <b>Last modified:</b> 2017-07-14</p>
<p><b>Priority: </b>0
</p>
<p><b>View other</b> <a href="lwg-index-open.html#variant.variant">active issues</a> in [variant.variant].</p>
<p><b>View all other</b> <a href="lwg-index.html#variant.variant">issues</a> in [variant.variant].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<b>Addresses US 113</b>

<p>Variants cannot properly support allocators, as any assignment of a subsequent value throws away the allocator used at 
construction. This is not an easy problem to solve, so <tt>variant</tt> would be better served dropping the illusion of 
allocator support for now, leaving open the possibility to provide proper support once the problems are fully understood.</p>

<p>Proposed change: Strike the 8 allocator aware constructor overloads from the class definition, and strike 
20.7.2.1 [variant.ctor] p34/35. Strike clause 20.7.12 [variant.traits]. Strike the specialization of 
<tt>uses_allocator</tt> for <tt>variant</tt> in the <tt>&lt;variant&gt;</tt> header synopsis, 20.7.1 [variant.general].</p>

<p><i>[2017-02-28, Kona, Casey provides wording]</i></p>


<p><i>[2017-06-29 Moved to Tentatively Ready after 7 positive votes on c++std-lib.]</i></p>


<p><i>[2017-07 Toronto Moved to Immediate]</i></p>



<p><b>Proposed resolution:</b></p>
<p>
This wording is relative to <a href="http://wg21.link/n4659">N4659</a>.
</p>

<ol>
<li><p>Change 23.7.2 [variant.syn], header <tt>&lt;variant&gt;</tt>  synopsis, as follows:</p>

<blockquote><pre>
[&hellip;]
<del><i>// 23.7.13 [variant.traits], allocator-related traits</i>
template &lt;class T, class Alloc&gt; struct uses_allocator;
template &lt;class... Types, class Alloc&gt; struct uses_allocator&lt;variant&lt;Types...&gt;, Alloc&gt;;</del>
</pre></blockquote>
</li>

<li><p>Change 23.7.3 [variant.variant], class template <tt>variant</tt>  synopsis, as follows:</p>

<blockquote><pre>
[&hellip;]
<del><i>// allocator-extended constructors</i>
template &lt;class Alloc&gt;
  variant(allocator_arg_t, const Alloc&amp;);
template &lt;class Alloc&gt;
  variant(allocator_arg_t, const Alloc&amp;, const variant&amp;);
template &lt;class Alloc&gt;
  variant(allocator_arg_t, const Alloc&amp;, variant&amp;&amp;);
template &lt;class Alloc, class T&gt;
  variant(allocator_arg_t, const Alloc&amp;, T&amp;&amp;);
template &lt;class Alloc, class T, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp;, in_place_type_t&lt;T&gt;, Args&amp;&amp;...);
template &lt;class Alloc, class T, class U, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp;, in_place_type_t&lt;T&gt;,
          initializer_list&lt;U&gt;, Args&amp;&amp;...);
template &lt;class Alloc, size_t I, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp;, in_place_index_t&lt;I&gt;, Args&amp;&amp;...);
template &lt;class Alloc, size_t I, class U, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp;, in_place_index_t&lt;I&gt;,
          initializer_list&lt;U&gt;, Args&amp;&amp;...);</del>
</pre></blockquote>
</li>

<li><p>Modify 23.7.3.1 [variant.ctor] as indicated:</p>
<blockquote><pre>
<del><i>// allocator-extended constructors</i>
template &lt;class Alloc&gt;
  variant(allocator_arg_t, const Alloc&amp; a);
template &lt;class Alloc&gt;
  variant(allocator_arg_t, const Alloc&amp; a, const variant&amp; v);
template &lt;class Alloc&gt;
  variant(allocator_arg_t, const Alloc&amp; a, variant&amp;&amp; v);
template &lt;class Alloc, class T&gt;
  variant(allocator_arg_t, const Alloc&amp; a, T&amp;&amp; t);
template &lt;class Alloc, class T, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp; a, in_place_type_t&lt;T&gt;, Args&amp;&amp;... args);
template &lt;class Alloc, class T, class U, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp; a, in_place_type_t&lt;T&gt;,
          initializer_list&lt;U&gt; il, Args&amp;&amp;... args);
template &lt;class Alloc, size_t I, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp; a, in_place_index_t&lt;I&gt;, Args&amp;&amp;... args);
template &lt;class Alloc, size_t I, class U, class... Args&gt;
  variant(allocator_arg_t, const Alloc&amp; a, in_place_index_t&lt;I&gt;,
          initializer_list&lt;U&gt; il, Args&amp;&amp;... args);</del>
</pre>
<blockquote>
<p>
<del>-34- <i>Requires:</i> <tt>Alloc</tt> shall meet the requirements for an Allocator 
(20.5.3.5 [allocator.requirements]).</del>
<p/>
<del>-35- <i>Effects:</i> Equivalent to the preceding constructors except that the contained value is constructed with
uses-allocator construction (23.10.7.2 [allocator.uses.construction]).</del>
</p>
</blockquote>
</blockquote>
</li>

<li><p>Modify 23.7.13 [variant.traits] as indicated:</p>

<blockquote>
<pre>
<del>template &lt;class... Types, class Alloc&gt;
struct uses_allocator&lt;variant&lt;Types...&gt;, Alloc&gt; : true_type { };</del>
</pre>
<blockquote>
<p>
<del>-1- <i>Requires:</i> <tt>Alloc</tt> shall be an Allocator (20.5.3.5 [allocator.requirements]).</del>
<p/>
<del>-2- [<i>Note:</i> Specialization of this trait informs other library components that variant can be constructed
with an allocator, even though it does not have a nested <tt>allocator_type</tt>. &mdash; <i>end note</i>]</del>
</p>
</blockquote>
</blockquote>
</li>
</ol>





<hr>
<h3><a name="2956" href="#2956">2956.</a> <tt>filesystem::canonical()</tt> still defined in terms of <tt>absolute(p, base)</tt></h3>
<p><b>Section:</b> 30.10.15.2 [fs.op.canonical] <b>Status:</b> <a href="lwg-active.html#Immediate">Immediate</a>
 <b>Submitter:</b> Sergey Zubkov <b>Opened:</b> 2017-04-21 <b>Last modified:</b> 2017-07-14</p>
<p><b>Priority: </b>1
</p>
<p><b>View all issues with</b> <a href="lwg-status.html#Immediate">Immediate</a> status.</p>
<p><b>Discussion:</b></p>
<p>
This is from editorial issue <a href="http://github.com/cplusplus/draft/issues/1620">#1620</a>:
<p/>
Since the resolution of US-78 was applied (as part of <a href="http://wg21.link/p0492r2">P0492R2</a>),
<tt>std::filesystem::absolute(path, base)</tt> no longer exists. However, <tt>std::filesystem::canonical</tt> 
is still defined in terms of <tt>absolute(p, base)</tt>.
</p>

<p><i>[2017-06-27 P1 after 5 positive votes on c++std-lib]</i></p>

<p>
Davis Herring: This needs to be P1 &mdash; due to a wording gap in <a href="http://wg21.link/p0492r2">P0492R2</a>, 2 out of the 
3 overloads of <tt>filesystem::canonical()</tt> have bad signatures and are unimplementable.
</p>

<p><i>[2017-07-14, Toronto, Davis Herring provides wording]</i></p>

<p><i>[2017-07-14, Toronto, Moved to Immediate]</i></p>



<p><b>Proposed resolution:</b></p>
<p>
This wording is relative to <a href="https://wg21.link/n4659">N4659</a>.
</p>

<ol>
<li><p>Edit 30.10.6 [fs.filesystem.syn] as indicated:</p>

<blockquote>
<pre>
path canonical(const path&amp; p<del>, const path&amp; base = current_path()</del>);
path canonical(const path&amp; p, error_code&amp; ec);
<del>path canonical(const path&amp; p, const path&amp; base, error_code&amp; ec);</del>
</pre>
</blockquote>
</li>

<li><p>Edit 30.10.15.2 [fs.op.canonical] as indicated:</p>

<blockquote>
<pre>
path canonical(const path&amp; p<del>, const path&amp; base = current_path()</del>);
path canonical(const path&amp; p, error_code&amp; ec);
<del>path canonical(const path&amp; p, const path&amp; base, error_code&amp; ec);</del>
</pre>
<blockquote>
<p>
-1- <i>Effects:</i> Converts <tt>p</tt>, which must exist, to an absolute path that has no symbolic link, <i>dot</i>, or 
<i>dot-dot</i> elements in its pathname in the generic format.
<p/>
-2- <i>Returns:</i> A path that refers to the same file system object as <tt>absolute(p<del>, base</del>)</tt>. <del>For 
the overload without a <tt>base</tt> argument, <tt>base</tt> is <tt>current_path()</tt>. Signatures</del><ins>The signature</ins> 
with argument <tt>ec</tt> return<ins>s</ins> <tt>path()</tt> if an error occurs.
<p/>
[&hellip;]
</p>
</blockquote>
</blockquote>
</li>

</ol>





</body>
</html>
