<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 2694: Application of LWG 436 accidentally deleted definition of "facet"</title>
<meta property="og:title" content="Issue 2694: Application of LWG 436 accidentally deleted definition of &quot;facet&quot;">
<meta property="og:description" content="C++ library issue. Status: C++17">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue2694.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++17">C++17</a> status.</em></p>
<h3 id="2694"><a href="lwg-defects.html#2694">2694</a>. Application of LWG 436 accidentally deleted definition of "facet"</h3>
<p><b>Section:</b> 28.3.3.1.2.2 <a href="https://wg21.link/locale.facet">[locale.facet]</a> <b>Status:</b> <a href="lwg-active.html#C++17">C++17</a>
 <b>Submitter:</b> Tim Song <b>Opened:</b> 2016-04-15 <b>Last modified:</b> 2017-07-30</p>
<p><b>Priority: </b>3
</p>
<p><b>View all other</b> <a href="lwg-index.html#locale.facet">issues</a> in [locale.facet].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++17">C++17</a> status.</p>
<p><b>Discussion:</b></p>
<p>
[locale.facet]/1 (then-called [lib.locale.facet]) read in C++03:
</p>
<blockquote>
<p>
Class <code>facet</code> is the base class for locale feature sets. A class is a <i>facet</i> if it is publicly derived 
from another facet, or if it is a class derived from <code>locale::facet</code> and containing a publicly-accessible 
declaration as follows: [<i>Footnote</i>: This is a complete list of requirements; there are no other requirements. 
Thus, a facet class need not have a public copy constructor, assignment, default constructor, destructor, etc.]
</p>
<blockquote><pre>
static ::std::locale::id id;
</pre></blockquote>
<p>
Template parameters in this clause which are required to be facets are those named <code>Facet</code> in declarations. 
A program that passes a type that is <em>not</em> a facet, as an (explicit or deduced) template parameter to a locale 
function expecting a facet, is ill-formed.
</p>
</blockquote>
<p>
LWG <a href="lwg-defects.html#436" title="are cv-qualified facet types valid facets? (Status: CD1)">436</a><sup><a href="https://cplusplus.github.io/LWG/issue436" title="Latest snapshot">(i)</a></sup>'s intent appears to be to ban <code>volatile</code>-qualified facets and permitting 
<code>const</code>-qualified ones. The PR was somewhat poorly worded, however, and the editor in applying 
it deleted the whole first half of the paragraph, including the definition of <i>facet</i> and the requirement 
for a static data member named <code>id</code>.
<p/>
As a result, we have things like 28.3.3.1.2.3 <a href="https://wg21.link/locale.id">[locale.id]</a>/2 and 28.3.3.2 <a href="https://wg21.link/locale.global.templates">[locale.global.templates]</a>/1 referring 
to the <code>id</code> member that's not defined anywhere in the working draft.
</p>

<p><i>[2016-08-03 Chicago]</i></p>

<p>Fri AM: Moved to Tentatively Ready</p>


<p id="res-2694"><b>Proposed resolution:</b></p>
<p>
This wording is relative to N4582.
</p>
<ol>
<li><p>Insert the following paragraph before 28.3.3.1.2.2 <a href="https://wg21.link/locale.facet">[locale.facet]</a>/1:</p>

<blockquote>
<p>
<ins>-?- Class <code>facet</code> is the base class for locale feature sets. A class is a <i>facet</i> if it is publicly 
derived from another facet, or if it is a class derived from <code>locale::facet</code> and containing a publicly accessible 
declaration as follows: [<i>Footnote</i>: This is a complete list of requirements; there are no other requirements. Thus, a 
facet class need not have a public copy constructor, assignment, default constructor, destructor, etc.]</ins>
</p>
<blockquote><pre>
<ins>static ::std::locale::id id;</ins>
</pre></blockquote>
<p>
-1- Template parameters in this Clause which are required to be facets are those named <code>Facet</code> in declarations. A
program that passes a type that is <i>not</i> a facet, or a type that refers to a volatile-qualified facet, as an (explicit
or deduced) template parameter to a locale function expecting a facet, is ill-formed. A const-qualified facet is
a valid template argument to any locale function that expects a Facet template parameter.
</p>
</blockquote>
</li>
</ol>





</body>
</html>
