[patch] : Improve std::search on v7
chris jefferson
caj@cs.york.ac.uk
Sun Jun 19 09:27:00 GMT 2005
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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ChangeLog-search
Type: application/text
Size: 516 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050619/c1d8df80/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-search
Type: application/text
Size: 10565 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050619/c1d8df80/attachment-0001.bin>
More information about the Libstdc++
mailing list