Section: 28.6.11.2.2 [re.tokiter.cnstr] Status: NAD Editorial Submitter: Daniel Krügler Opened: 2007-03-03 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [re.tokiter.cnstr].
View all issues with NAD Editorial status.
Discussion:
In 28.6.11.2.2 [re.tokiter.cnstr]/1+2 both the constructor declaration and the following text shows some obvious typos:
1) The third constructor form is written as
template <std::size_t N> regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, const int (&submatches)[R], regex_constants::match_flag_type m = regex_constants::match_default);
where the dimensions of submatches are specified by an unknown value R, which should be N.
2) Paragraph 2 of the same section says in its 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, &submatches + R)
.
where again R must be replaced by N.
3) Paragraph 3 of the same section says in its first sentence:
Each constructor then sets
N
to0
, andposition
toposition_iterator(a, b, re, f)
.
where a non-existing parameter "f" is mentioned, which must be replaced by the parameter "m".
Proposed resolution:
Change 28.6.11.2.2 [re.tokiter.cnstr]/1:
template <std::size_t N> regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re, const int (&submatches)[RN], regex_constants::match_flag_type m = regex_constants::match_default);
Change 28.6.11.2.2 [re.tokiter.cnstr]/2:
Effects: The first constructor initializes the member
subs
to hold the single valuesubmatch
. The second constructor initializes the membersubs
to hold a copy of the argumentsubmatches
. The third constructor initializes the membersubs
to hold a copy of the sequence of integer values pointed to by the iterator range[&submatches, &submatches +
.RN)
Change 28.6.11.2.2 [re.tokiter.cnstr]/3:
Each constructor then sets
N
to0
, andposition
toposition_iterator(a, b, re,
. Iffm)position
is not an end-of-sequence iterator the constructor setsresult
to the address of the current match. Otherwise if any of the values stored insubs
is equal to-1
the constructor sets*this
to a suffix iterator that points to the range[a, b)
, otherwise the constructor sets*this
to an end-of-sequence iterator.