forked from lwg/issues
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New issue from Jiang An: "Static data members of ctype_base are not y…
…et required to be usable in constant expressions"
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version='1.0' encoding='utf-8' standalone='no'?> | ||
<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> | ||
|
||
<issue num="4037" status="New"> | ||
<title>Static data members of <tt>ctype_base</tt> are not yet required to be usable in constant expressions</title> | ||
<section><sref ref="[category.ctype.general]"/></section> | ||
<submitter>Jiang An</submitter> | ||
<date>12 Jan 2024</date> | ||
<priority>99</priority> | ||
|
||
<discussion> | ||
<p> | ||
It may be desired that static data members <tt>ctype_base</tt> are "real constants", i.e. usable in constant expressions. | ||
However, this is not strictly required because <tt>mask</tt> is only required to be a bitmask type that can be a class type, | ||
which makes the plain <tt>const</tt> potentially insufficient. | ||
</p> | ||
</discussion> | ||
|
||
<resolution> | ||
<p> | ||
This wording is relative to <paper num="N4971"/>. | ||
</p> | ||
|
||
<ol> | ||
|
||
<li><p>Modify <sref ref="[category.ctype.general]"/> as indicated:</p> | ||
|
||
<blockquote> | ||
<blockquote> | ||
<pre> | ||
namespace std { | ||
class ctype_base { | ||
public: | ||
using mask = <i>see below</i>; | ||
|
||
// <i>numeric values are for exposition only.</i> | ||
static const<ins>expr</ins> mask space = 1 << 0; | ||
static const<ins>expr</ins> mask print = 1 << 1; | ||
static const<ins>expr</ins> mask cntrl = 1 << 2; | ||
static const<ins>expr</ins> mask upper = 1 << 3; | ||
static const<ins>expr</ins> mask lower = 1 << 4; | ||
static const<ins>expr</ins> mask alpha = 1 << 5; | ||
static const<ins>expr</ins> mask digit = 1 << 6; | ||
static const<ins>expr</ins> mask punct = 1 << 7; | ||
static const<ins>expr</ins> mask xdigit = 1 << 8; | ||
static const<ins>expr</ins> mask blank = 1 << 9; | ||
static const<ins>expr</ins> mask alnum = alpha | digit; | ||
static const<ins>expr</ins> mask graph = alnum | punct; | ||
}; | ||
} | ||
</pre> | ||
</blockquote> | ||
<p> | ||
-1- The type mask is a bitmask type (<sref ref="[bitmask.types]"/>). | ||
</p> | ||
</blockquote> | ||
|
||
|
||
</li> | ||
|
||
</ol> | ||
|
||
|
||
</resolution> | ||
|
||
</issue> |