This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/58358] [4.7/4.8/4.9 Regression] search_n has a Complexity violation for random access iterator


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58358

--- Comment #15 from Mitsuru Kariya <kariya_mitsuru at hotmail dot com> ---
Created attachment 30775
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30775&action=edit
Patch

For your convenience, I attached a patch for this problem.

This algorithm is always scanned to reverse order.
If a scan fails in less than enough, a re-scan is performed from the point that
advanced necessary elements from the original starting point.

For example, if __count is 20 and a scan fails after 18 elements succeeded, a
re-scan is performed from the point that advanced 2 elements.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]