Created on 2008-09-26.00:00:00 last changed 161 months ago
Proposed resolution:
In [re.tokiter]/6 and the list [re.tokiter.cnstr]/10-11 insert the following constructor declaration between the already existing ones accepting a std::vector and a C array of int, resp.:
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, initializer_list<int> submatches, regex_constants::match_flag_type m = regex_constants::match_default);
In [re.tokiter.cnstr]/12 change the last sentence
The third and fourth constructor initialize
sthe member subs to hold a copy of the sequence of integer values pointed to by the iterator range [&submatches,&submatches + N) and [submatches.begin(),submatches.end()), respectively.
[ Batavia (2009-05): ]
We strongly recommend alternative B of the proposed resolution in order that existing code not be broken. With that understanding, move to Tentatively Ready.
Original proposed wording:
In [re.tokiter]/6 and the list [re.tokiter.cnstr]/10-11 change the constructor declaration:
template <std::size_t N>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,const int (&submatches)[N]initializer_list<int> submatches, regex_constants::match_flag_type m = regex_constants::match_default);
In [re.tokiter.cnstr]/12 change the last sentence
The third constructor initializes the member subs to hold a copy of the sequence of integer values pointed to by the iterator range [
&submatches.begin(),&submatches.end()+ N).
In [re.tokiter]/6 and the list [re.tokiter.cnstr]/10-11 insert the following constructor declaration between the already existing ones accepting a std::vector and a C array of int, resp.:
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, initializer_list<int> submatches, regex_constants::match_flag_type m = regex_constants::match_default);
In [re.tokiter.cnstr]/12 change the last sentence
The third and fourth constructor initialize
sthe member subs to hold a copy of the sequence of integer values pointed to by the iterator range [&submatches,&submatches + N) and [submatches.begin(),submatches.end()), respectively.
Addresses UK 319
Construction of a regex_token_iterator ([re.tokiter]/6+) usually requires the provision of a sequence of integer values, which can currently be done via a std::vector<int> or a C array of int. Since the introduction of initializer_list in the standard it seems much more reasonable to provide a corresponding constructor that accepts an initializer_list<int> instead. This could be done as a pure addition or one could even consider replacement. The author suggests the replacement strategy (A), but provides an alternative additive proposal (B) as a fall-back, because of the handiness of this range type:
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg4315 |
2010-10-21 18:28:33 | admin | set | messages: + msg4314 |
2008-09-26 00:00:00 | admin | create |