Title
Several typos in regex_token_iterator constructors
Status
nad editorial
Section
[re.tokiter.cnstr]
Submitter
Daniel Krügler

Created on 2007-03-03.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [re.tokiter.cnstr]/1:

template <std::size_t N>
  regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, 
                       const regex_type& re, 
                       const int (&submatches)[R N], 
                       regex_constants::match_flag_type m = 
                         regex_constants::match_default);

Change [re.tokiter.cnstr]/2:

Effects: The first constructor initializes the member subs to hold the single value submatch. The second constructor initializes the member subs to hold a copy of the argument submatches. 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 N).

Change [re.tokiter.cnstr]/3:

Each constructor then sets N to 0, and position to position_iterator(a, b, re, f m). If position is not an end-of-sequence iterator the constructor sets result to the address of the current match. Otherwise if any of the values stored in subs 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.

Date: 2007-03-03.00:00:00

In [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 to 0, and position to position_iterator(a, b, re, f).

where a non-existing parameter "f" is mentioned, which must be replaced by the parameter "m".

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3331
2007-03-03 00:00:00admincreate