Title
Missing members in match_results
Status
nad editorial
Section
[re.results]
Submitter
Daniel Krügler

Created on 2007-02-26.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Add the following members to the match_results synopsis after end() in [re.results] para 3:

const_iterator cbegin() const; 
const_iterator cend() const;

In section [re.results.acc] change:

const_iterator begin() const;
const_iterator cbegin() const;

-7- Returns: A starting iterator that enumerates over all the sub-expressions stored in *this.

const_iterator end() const;
const_iterator cend() const;

-8- Returns: A terminating iterator that enumerates over all the sub-expressions stored in *this.

Date: 2007-02-26.00:00:00

According to the description given in [re.results]/2 the class template match_results "shall satisfy the requirements of a Sequence, [..], except that only operations defined for const-qualified Sequences are supported". Comparing the provided operations from [re.results]/3 with the sequence/container tables 80 and 81 one recognizes the following missing operations:

1) The members

const_iterator rbegin() const;
const_iterator rend() const;

should exists because 23.1/10 demands these for containers (all sequences are containers) which support bidirectional iterators. Aren't these supported by match_result? This is not explicitely expressed, but it's somewhat implied by two arguments:

(a) Several typedefs delegate to iterator_traits<BidirectionalIterator>.

(b) The existence of const_reference operator[](size_type n) const implies even random-access iteration. I also suggest, that match_result should explicitly mention, which minimum iterator category is supported and if this does not include random-access the existence of operator[] is somewhat questionable.

2) The new "convenience" members

const_iterator cbegin() const;
const_iterator cend() const;
const_iterator crbegin() const;
const_iterator crend() const;

should be added according to tables 80/81.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3323
2007-02-26 00:00:00admincreate