This is the mail archive of the
mailing list for the GCC project.
[patch] : Improve std::search on v7
- From: chris jefferson <caj at cs dot york dot ac dot uk>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 19 Jun 2005 10:27:31 +0100
- Subject: [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
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!