682. basic_regex ctor takes InputIterator or ForwardIterator?

Section: 31.8.2 [re.regex.construct] Status: CD1 Submitter: Eric Niebler Opened: 2007-06-03 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [re.regex.construct].

View all issues with CD1 status.

Discussion:

Looking at N2284, 31.8 [re.regex], p3 basic_regex class template synopsis shows this constructor:

template <class InputIterator>
     basic_regex(InputIterator first, InputIterator last, 
                 flag_type f = regex_constants::ECMAScript);

In 31.8.2 [re.regex.construct], p15, the constructor appears with this signature:

template <class ForwardIterator>
     basic_regex(ForwardIterator first, ForwardIterator last, 
                 flag_type f = regex_constants::ECMAScript);

ForwardIterator is probably correct, so the synopsis is wrong.

[ John adds: ]

I think either could be implemented? Although an input iterator would probably require an internal copy of the string being made.

I have no strong feelings either way, although I think my original intent was InputIterator.

Proposed resolution:

Adopt the proposed resolution in N2409.

[ Kona (2007): The LWG adopted the proposed resolution of N2409 for this issue. The LWG voted to accelerate this issue to Ready status to be voted into the WP at Kona. ]