This is the mail archive of the gcc-patches@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]

[patch] : Improve std::search on v7


This is quite a simple patch that does a few things.

1) Adds a new version of a more generic bind2nd to predefined_ops.h (if anyone has the old copy, it should be dumped and the file replaced with a clean CVS version, then this patch applied.

This uses the "Empty Base Optimization" to avoid PR20408, but even if that is fixed it still probably provides a very small, although perhaps not measurable, improvement. We have to then overload the class for binary functions, as they can't be inherited from.

2) Uses this class to clean up std::search, delegate to find_if, and also neaten the algorithm slightly. This algorithm is the forward iterator overload

3) Add a random access iterator overload, which makes use of the fact we can calculate all the relevant bounds quickly, and so can save a few checks

4) Adds some new tests to check all this!


Attachment: ChangeLog-search
Description: application/text

Attachment: patch-search
Description: application/text


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