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: "Constants in std::regex_constants should be…
… allowed to be enumerators"
- Loading branch information
Showing
1 changed file
with
32 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,32 @@ | ||
<?xml version='1.0' encoding='utf-8' standalone='no'?> | ||
<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> | ||
|
||
<issue num="3998" status="New"> | ||
<title>Constants in <tt>std::regex_constants</tt> should be allowed to be enumerators</title> | ||
<section><sref ref="[re.const]"/></section> | ||
<submitter>Jiang An</submitter> | ||
<date>18 Oct 2023</date> | ||
<priority>99</priority> | ||
|
||
<discussion> | ||
<p> | ||
Currently, MSVC STL and libc++ implement constants in <tt>std::regex_constants</tt> as | ||
enumerators of unscoped enumerations, while the standard specify them to be <tt>constexpr</tt> variables. | ||
<p/> | ||
<a href="https://github.com/microsoft/STL/issues/4100#issuecomment-1767717721">Casey Carter argued</a> | ||
that it would be better to make these constants prvalues to avoid wasting space in object files. And | ||
presumably almost all users just use their values without odr-using them or relying on their value category. | ||
<p/> | ||
Perhaps we should allow these constants to be enumerators of the corresponding type (<tt>syntax_option_type</tt>, | ||
<tt>match_flag_type</tt>, or <tt>error_type</tt>) if the corresponding type is an enumeration. | ||
<p/> | ||
Notes: since C++20, we can even make the enumeration types scoped and expose the enumerators to the | ||
namespace by using-declaration or using-enum-declaration. <paper num="P0439R0"/> might be related, | ||
since it changed former enumerators to <tt>constexpr</tt> variables. | ||
</p> | ||
</discussion> | ||
|
||
<resolution> | ||
</resolution> | ||
|
||
</issue> |