Type of std::regex_constants bitmasks

38 views
Skip to first unread message

Jim Porter

unread,
Feb 20, 2015, 4:11:38 AM2/20/15
to std-dis...@isocpp.org
Are std::regex_constants::syntax_option_type and
std::regex_constants::match_flag_type guaranteed to be distinct types?
Since [bitmask.types] says they can be defined as integer types, I'm
guessing there's no such guarantee, but [re.const] could be read to say
otherwise: "This namespace provides three types, syntax_option_type,
match_flag_type, and error_type...".

If the standard doesn't currently guarantee that these types are
distinct, should it? It would help to prevent any errors from using the
incorrect set of constants in the regex functions.

(For more details, I ask because I'd like to perform a regex match from
using a string for the expression, like so:

my_regex_match("foo", syntax, match_flag);

where either syntax or match_flag can be omitted.)

- Jim

Daniel Krügler

unread,
Feb 25, 2015, 12:39:36 PM2/25/15
to std-dis...@isocpp.org
I recommend to submit a library issue to the lwgchair address, see

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html

-Daniel
Reply all
Reply to author
Forward
0 new messages