Last Updated: May 17, 2026
The <algorithm> header has a second large family beyond searching: algorithms that produce a modified version of a range. They cover the everyday transformations you'd otherwise write loops for, copying, mapping values, replacing matches, filling, reversing, and removing. This chapter walks through each operation, the output iterator concept that makes them composable, and the erase-remove idiom that catches more new C++ developers than any other STL pattern.