STL algorithms, such as for_each , accept function objects that can be easily embedded. C, on the other hand, uses function pointers, which are much more complicated for the compiler optimizer.
This is important in some algorithms, such as sorting, in which a matching function must be called many times.
Wikipedia has more information if you are interested.
EDIT:
As for the STL vector class, I don't think this is necessarily faster than what you could find, say, glibc.
Manuel
source share