Topic: Defect Report: basic_regex ctor takes InputIterator or ForwardIterator ?
Author: foo@bar.com ("foobar")
Date: Thu, 7 Jun 2007 16:38:13 GMT Raw View
Eric Niebler wrote:
> Looking at N2284, 28.8/3 basic_regex class template synopsis shows
> this constructor:
>
> template <class InputIterator>
> basic_regex(InputIterator first, InputIterator last,
> flag_type f = regex_constants::ECMAScript);
>
> In 28.8.2/15, 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.
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.
John.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]