<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2940: result_of specification also needs a little cleanup</title>
<meta property="og:title" content="Issue 2940: result_of specification also needs a little cleanup">
<meta property="og:description" content="C++ library issue. Status: C++20">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2940.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++20">C++20</a> status.</em></p>
<h3 id="2940"><a href="lwg-defects.html#2940">2940</a>. <code>result_of</code> specification also needs a little cleanup</h3>
<p><b>Section:</b> D.13 <a href="https://wg21.link/depr.meta.types">[depr.meta.types]</a> <b>Status:</b> <a href="lwg-active.html#C++20">C++20</a>
 <b>Submitter:</b> Daniel Kr&uuml;gler <b>Opened:</b> 2017-03-04 <b>Last modified:</b> 2021-02-25</p>
<p><b>Priority: </b>3
</p>
<p><b>View all other</b> <a href="lwg-index.html#depr.meta.types">issues</a> in [depr.meta.types].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++20">C++20</a> status.</p>
<p><b>Discussion:</b></p>
<p>
<a href="https://wg21.link/p0604r0">P0604R0</a> missed a similar adjustment that was performed for the
deprecated type trait templates <code>is_literal_type</code> and <code>is_literal_type_v</code> via LWG <a href="lwg-defects.html#2838" title="is_literal_type specification needs a little cleanup (Status: C++17)">2838</a><sup><a href="https://cplusplus.github.io/LWG/issue2838" title="Latest snapshot">(i)</a></sup>: 
<p/>
Moving the <code>result_of</code> to Annex D means that the general prohibition against specializing type traits 
in [meta.type.synop]/1 does no longer exist, so should be explicitly spelled out. Wording will be provided
after publication of the successor of <a href="https://wg21.link/n4640">N4640</a>.
</p>

<p><i>[2017-03-04, Kona]</i></p>

<p>Set priority to 3</p>

<p><i>[2017-04-24, Daniel provides wording]</i></p>

<p>
Instead of enumerating all the templates where adding a specialization is valid, a general exclusion rule is provided.
Albeit currently not needed for the templates handled by this sub-clause, a potential exception case is constructed
to ensure correctness for the first deprecated trait template that would permit specializations by the user.
</p>

<p><i>[2017-06-10, Moved to Tentatively Ready after 6 positive votes on c++std-lib]</i></p>



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

<ol>
<li><p>Change D.13 <a href="https://wg21.link/depr.meta.types">[depr.meta.types]</a> as indicated:</p>
<blockquote>
<p>
-4- The behavior of a program that adds specializations for <ins>any of the templates defined in this subclause</ins> 
<del><code>is_literal_type</code> or <code>is_literal_type_v</code></del> is undefined<ins>, unless explicitly permitted by the
specification of the corresponding template</ins>.
</p>
</blockquote>
</li>
</ol>







</body>
</html>
