Created on 2010-10-21.00:00:00 last changed 161 months ago
Proposed resolution:
Change the class template basic_regex synopsis, [re.regex] p. 3, as indicated:
namespace std { template <class charT, class traits = regex_traits<charT> > class basic_regex { public: // types: typedef charT value_type; typedef traits traits_type; typedef typename traits::string_type string_type; typedef regex_constants::syntax_option_type flag_type; typedef typename traits::locale_type locale_type; [..] }; }
[ 2011-02-24 Reflector discussion ]
Moved to Tentatively Ready after 6 votes.
[ 2011-02-16: Daniel comments and provides an alternative resolution. ]
I'm strongly in favour with the Batavia idea to provide a separate string_type within basic_regex, but it seems to me that the issue resultion should add one more important typedef, namely that of the traits type! Currently, basic_regex is the only template that does not publish the type of the associated traits type. Instead of opening a new issue, I added this suggestion as part of the proposed wording.
[ 2010 Batavia ]
Unsure if we should just give basic_regex a string_type typedef. Looking for when string_type was introduced into regex. Howard to draft wording for typedef typename traits::string_type string_type, then move to Review.
[ 2010-11-03 Daniel comments and suggests alternative wording: ]
The proposed resolution needs to use basic_string<charT> instead of basic_string<char>
Previous Proposed Resolution:
Make the following changes to [re.regex.assign]:basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);12 Returns: assign(
string_typebasic_string<charT>(ptr), f).basic_regex& assign(const charT* ptr, size_t len, flag_type f = regex_constants::ECMAScript);13 Returns: assign(
string_typebasic_string<charT>(ptr, len), f).[..] template <class InputIterator> basic_regex& assign(InputIterator first, InputIterator last, flag_type f = regex_constants::ECMAScript);18 Requires: The type InputIterator shall satisfy the requirements for an Input Iterator (24.2.3).
19 Returns: assign(
string_typebasic_string<charT>(first, last), f).
In working draft N3126, subclause [re.regex.assign], paragraphs 12, 13 and 19, the name string_type is used. This is presumably a typedef for basic_string<value_type>, where value_type is the character type used by basic_regex. The basic_regex template however defines no such typedef, and neither does the <regex> header or the <initializer_list> header included by <regex>.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2011-04-11 11:23:23 | admin | set | status: voting -> wp |
2011-03-05 15:24:28 | admin | set | status: ready -> voting |
2011-02-24 19:33:19 | admin | set | messages: + msg5538 |
2011-02-24 19:33:19 | admin | set | status: open -> ready |
2011-02-16 00:03:21 | admin | set | messages: + msg5492 |
2010-11-13 23:03:59 | admin | set | messages: + msg5360 |
2010-11-13 23:03:59 | admin | set | status: new -> open |
2010-11-02 20:31:48 | admin | set | messages: + msg5278 |
2010-10-23 17:22:18 | admin | set | messages: + msg4896 |
2010-10-21 00:00:00 | admin | create |