This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/58358] [4.7/4.8/4.9 Regression] search_n has a Complexity violation for random access iterator
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 08 Sep 2013 19:26:26 +0000
- Subject: [Bug libstdc++/58358] [4.7/4.8/4.9 Regression] search_n has a Complexity violation for random access iterator
- Auto-submitted: auto-generated
- References: <bug-58358-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58358
--- Comment #12 from Marc Glisse <glisse at gcc dot gnu.org> ---
Chris, did you consider applying this optimized code to bidirectional iterators
and not just random access iterators? We may end up doing a few more ++/-- than
necessary, but not by more than a factor 2 I believe, and we would often save
many calls to the predicate. Something may also be doable for forward
iterators, but that's more complicated for less gain and couldn't share the
same code.