Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22022

Why is `std::find_if` implemented by loop unrolling but `std::for_each` isn't?

$
0
0

The gcc implementation of the standard library implements find_if using loop unrolling for RA iterators, and other search functions (search, none_of, find, etc) are implemented by calling find_if to reuse that optimization if it applies.

However, why is find_if the only function optimized that way, and not, for instance, std::for_each?


Viewing all articles
Browse latest Browse all 22022

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>