<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
    <title>Rebase the Library Fundamentals v3 TS on C++20</title>
    <style type="text/css">
      html { margin: 0; padding: 0; color: black; background-color: white; }
      body { padding: 2em; font-size: medium; font-family: "DejaVu Serif", serif; line-height: 150%; }
      code { font-family: "DejaVu Sans Mono", monospace; color: #006; }

      h1, h2, h3 { margin: 1.5em 0 .75em 0; line-height: 125%; }

      sup, sub { line-height: 0; }

      div.code { white-space: pre-line; font-family: "DejaVu Sans Mono", monospace;
                 border: thin solid #E0E0E0; background-color: #F8F8F8; padding: 1em;
                 border-radius: 4px; }

      div.strictpre { white-space: pre; }

      div.code em { font-family: "DejaVu Serif", serif; }

      table { border: 2px solid black; border-collapse: collapse; margin: 3em auto; }
      thead th { border-bottom: 2px solid black; }
      th, td { text-align: left; padding: 1ex; border: 1px solid black; }
      th:first-child, td:first-child { padding-left: 1ex; }

      tr.new td { background-color: #EFE; }
      td.new:after { content: "new!"; font-family: "DejaVu Sans", sans-serif; font-weight: bold; font-size: xx-small;
                     vertical-align: top; top: -1em; right: -1em; position: relative; float: right; color: #090; }

      .docinfo { float: right }
      .docinfo p { margin: 0; text-align:right; }
      .docinfo address { font-style: normal; }

      .quote { display: inline-block; clear: both; margin-left: 1ex;
               border: thin solid #E0E0E0; background-color: #F8F8F8; padding: 1ex; }

      /*  Use DIV[insert] and DIV[delete] if the entire paragraph is added or removed; otherwise
       *  use DIV[modify] and use INS/DEL elements to mark up individual changes.
       */

      div.insert { border-left: thick solid #0A0; border-right: thick solid #0A0; padding: 0 1em; }
      div.modify { border-left: thick solid #999; border-right: thick solid #999; padding: 0 1em; }
      div.delete { border-left: thick solid #A00; border-right: thick solid #A00; padding: 0 1em; }

      .comment { color: #753; }

      del { color: #A00; text-decoration: line-through; }
      ins { color: #090; }
      ins code, del code { color: inherit; }

      .box { border: thin black solid; padding: 2px; }

      .nowrap { white-space: nowrap; }
    </style>
  </head>
  <body>
    <div class="docinfo">
      <p>ISO/IEC JTC 1/SC 22/WG 21 P2081R0</p>
      <p>Date: 2020-01-13</p>
      <p>Audience: LEWG, LWG</p>
      <address>
        Thomas K&ouml;ppe &lt;<a href="mailto:tkoeppe@google.com">tkoeppe@google.com</a>&gt;<br />
      </address>
    </div>

    <h1>Rebase the Library Fundamentals v3 TS on C++20</h1>

    <h2>Abstract</h2>

    <p>The Library Fundamentals v3 TS should be based on C++20.</p>

    <h2>Contents</h2>
    <!-- fgrep -e "<h2 id=" rebase_lfts.html | sed -e 's/.*id="\(.*\)">\(.*\)<\/h2>/<li><a href="#\1">\2<\/a><\/li>/g' -->
    <ol>
      <li><a href="#proposal">Proposal</a></li>
      <li><a href="#wording">Proposed wording</a>
        <ol>
          <li><a href="#frontmatter">Front matter updates</a></li>
          <li><a href="#deletions">Deletions of merged material</a></li>
          <li><a href="#sysups">Systematic updates of the method of specification and presentation</a></li>
        </ol>
      </li>
    </ol>

    <h2 id="proposal">Proposal</h2>

    <p>The working draft of the Extensions for Library Fundamentals, Version 3
    Technical Specification (&ldquo;LFTSv3&rdquo; or just &ldquo;LFTS&rdquo; for
    short) is currently (as of
    <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0996r1.html">P0996R1</a>)
    based on the published C++ standard, i.e. C++17. It is very unlikely, and
    indeed not planned at this point, that we will publish the TS before the
    C++20 DIS has been published (which we expect to happen at the next meeting
    as of the time of writing, which is Prague 2020). Therefore, we have the option
    of basing the TS on the C++20 DIS, and we should do this to allow us to remove
    facilities that have been merged into the main standard, and to take advantage
    of new language facilities.</p>

    <p>If the C++20 IS is published before we complete the PDTS ballot for the
    LFTS, we should update the LFTS working draft to refer to the IS instead of
    the DIS. The acceptance of this proposal should include approval of such a
    future change, which would then be an editorial matter to align the wording
    with the design intent.</p>

    <h2 id="wording">Proposed wording</h2>

    <h3 id="frontmatter">Front matter updates</h3>
    
    <p>Modify [1.2, general.references] paragraphs 1, 2, and 3 as follows:</p>

    <div class="modify">
      <p><strong>1.2 Normative references [general.references]</strong></p>

      <p>1. The following referenced document is indispensable for the application
      of this document. For dated references, only the edition cited applies.
      For undated references, the latest edition of the referenced document
      (including any amendments) applies.</p>

      <ul><li>ISO/IEC <del>14882:2017</del><ins>14882:&ndash;</ins>, Programming Languages &mdash; C++</li></ul>
      <p><ins>[<em>Note</em>: Under preparation. Stage at the time of publication: ISO/DIS 14882:2020.
      &mdash;&nbsp;<em>end note</em>]</ins></p>

      <p>2. ISO/IEC <del>14882:2017</del><ins>14882:&ndash;</ins> is herein
      called the <em>C++ Standard</em>. References to clauses within the C++
      Standard are written as "<del>C++17</del><ins>C++20</ins> §3.2". The
      library described in ISO/IEC <del>14882:2017 clauses
      20&ndash;33</del><ins>14882:&ndash; clauses 16&ndash;32</ins> is herein
      called the <em>C++ Standard Library.</em></p>

      <p>3. Unless otherwise specified, the whole of the C++ Standard's Library
      introduction (<del>C++17 §20</del><ins>C++20 §16</ins>) is included into
      this Technical Specification by reference.</p>
    </div>

    <p>Modify [1.3, general.namespaces] paragraphs 2:</p>

    <div class="modify">
      <p>2. Each header described in this technical specification shall import the
        contents of <code>std::experimental::fundamentals_v3</code> into
        <code>std::experimental</code> as if by</p>
      <div class="code"><del>namespace std::experimental {</del>
        &nbsp; <del>inline namespace fundamentals_v3 {}</del>
        <del>}</del>
        <ins>namespace std::experimental::inline fundamentals_v3 {}</ins>
      </div>
    </div>

    <h3 id="deletions">Deletions of merged material</h3>
    
    <p>Delete subclause [6.1, container.erasure].</p>

    <div class="delete">
      <p><strong><del>6.1 Uniform container erasure [container.erasure]</del></strong></p>
      <p><strong><del>6.1.1 Header synopsis [container.erasure.syn]</del></strong></p>
      <p><del>1. For brevity, [&hellip;]</del></p>
      <p><del>[&hellip;] are intentionally not provided. &ndash;&nbsp;<em>end note</em>]</del></p>
    </div>

    <p>Delete clause [11, reflection].</p>
    <div class="delete">
      <p><strong><del>11 Reflection library [reflection]</del></strong></p>
      <p><del>[&hellip;]</del></p>
    </div>

    <p>Delete from Table 1 &mdash; C++ library headers:</p>
    <div class="modify">
      <code>&lt;experimental/algorithm&gt;</code><br>
      <code>&lt;experimental/array&gt;</code><br>
      <del><code>&lt;experimental/deque&gt;</code></del><br>
      <del><code>&lt;experimental/forward_list&gt;</code></del><br>
      <code>&lt;experimental/functional&gt;</code><br>
      <code>&lt;experimental/future&gt;</code><br>
      <code>&lt;experimental/iterator&gt;</code><br>
      <del><code>&lt;experimental/list&gt;</code></del><br>
      <del><code>&lt;experimental/map&gt;</code></del><br>
      <code>&lt;experimental/memory&gt;</code><br>
      <code>&lt;experimental/memory_resource&gt;</code><br>
      <code>&lt;experimental/propagate_const&gt;</code><br>
      <code>&lt;experimental/random&gt;</code><br>
      <code>&lt;experimental/scope&gt;</code><br>
      <del><code>&lt;experimental/set&gt;</code></del><br>
      <code>&lt;experimental/source_location&gt;</code><br>
      <del><code>&lt;experimental/string&gt;</code></del><br>
      <code>&lt;experimental/type_traits&gt;</code><br>
      <del><code>&lt;experimental/unordered_map&gt;</code></del><br>
      <del><code>&lt;experimental/unordered_set&gt;</code></del><br>
      <code>&lt;experimental/utility&gt;</code><br>
      <del><code>&lt;experimental/vector&gt;</code></del>
    </div>

    <p>Delete from Table 2 &mdash; Significant features in this technical specification:</p>

    <div class="modify">
      <table style="margin: 0;">
        <thead>
          <tr><th>Doc. No.</th><th>Title</th><th>[&hellip;]</th></tr>
        </thead>
        <tbody>
          <tr>
            <td>N4388</td>
            <td>A Proposal to Add a Const-Propagating Wrapper to the Standard Library</td>
            <td>[&hellip;]</td>
          </tr>
          <tr><td>[&hellip;]</td><td>[&hellip;]</td><td>[&hellip;]</td></tr>
          <tr>
            <td><del>N4273</del></td>
            <td><del>Uniform Container Erasure</del></td>
            <td><del>[&hellip;]</del></td>
          </tr>
          <tr><td>[&hellip;]</td><td>[&hellip;]</td><td>[&hellip;]</td></tr>
          <tr>
            <td><del>N4519</del></td>
            <td><del>Source-Code Information Capture</del></td>
            <td><del>[&hellip;]</del></td>
          </tr>
        </tbody>
      </table>
    </div>

    <h3 id="sysups">Systematic updates of the method of specification and presentation</h3>

    <p>Editorially apply the new compact inline namespace syntax wherever it applies.</p>

    <div class="modify">
      <p><strong>3.1.1 Header <code>&lt;experimental/utility&gt; synopsis [utility.syn]</code></strong></p>
      <div class="code">#include &lt;utility&gt;

        namespace std::experimental<ins>::inline fundamentals_v3</ins> {
        <del>inline namespace fundamentals_v3 {</del>

        // 3.1.2, Class erased_type
        struct erased_type { };

        <del>} // namespace fundamentals_v3</del>
        } // namespace std::experimental<ins>::inline fundamentals_v3</ins></div>
      <p>[Further edits not shown.]</p>
    </div>

    <p>Update section numbers, and update the &ldquo;C++17-concept&rdquo; names everywhere
      and replace &ldquo;satisfies&rdquo; with &ldquo;meets&rdquo;, e.g. &ldquo;satisfies
      the requirements of <code>CopyConstructible</code>&rdquo; becomes &ldquo;meets
      the <em>C++17CopyConstructible</em> requirements&rdquo;.</p>
    <div class="modify">
      <p><strong><del>20.7.7</del><ins>20.10.8</ins> uses_allocator [allocator.uses]</strong></p>
      <p><strong><del>20.7.7.1</del><ins>20.10.8.1</ins> uses_allocator trait [allocator.uses.trait]</strong></p>
      <p><code>template &lt;class T, class Alloc&gt; struct uses_allocator;</code></p>
      <p>
        1. <em>Remarks</em>: Automatically detects whether <code>T</code> has a nested
        <code>allocator_type</code> that is convertible from <code>Alloc</code>.
        Meets the <del>BinaryTypeTrait</del><ins><em>C++17BinaryTypeTrait</em></ins>
        requirements (<del>C++17 §23.15.1</del><ins>C++20 §20.15.1</ins>).
        The implementation shall provide a definition [&hellip;]
      </p>

      <p>[Further edits not shown.]</p>
    </div>

    <p>Update C++17-style <em>Requires</em>/<em>Remarks</em>/<em>Postconditions</em> into
      <em>Mandates</em>/<em>Expects</em>/<em>Constraints</em>/<em>Ensures</em>.</p>
    <div class="modify">
      <p><strong>3.2.2.3 propagate_const constructors [propagate_const.ctor]</strong></p>
      <p>[<em>Note</em>: The following constructors are conditionally specified as explicit.
        This is typically implemented by declaring two such constructors, of which at most
        one participates in overload resolution. &mdash; <em>end note</em>]</p>
      <p><code>template &lt;class U&gt; <em>see below</em> constexpr propagate_const(propagate_const&lt;U&gt;&amp;&amp; pu);</code></p>
      <p><em>Remarks</em>:
        <del>This constructor shall not participate in overload resolution unless <code>is_constructible_v&lt;T, U&amp;&amp;&gt;</code>.</del>
        The constructor is specified as explicit if and only if <code>!is_convertible_v&lt;U&amp;&amp;, T&gt;</code>.</p>
      <p><ins><em>Constraints</em>: <code>is_constructible_v&lt;T, U&amp;&amp;&gt;</code> is <code>true</code>.</ins></p>
      <p><em>Effects</em>: Initializes <code>t_</code> as if direct-non-list-initializing an object of type
        <code>T</code> with the expression <code>std::move(pu.t_)</code>.</p>
      <p>[Further edits not shown, will be included in a future revision.]</p>
    </div>

  </body>
</html>
