C++ Algorithms and Ranges
C++ Algorithms and Ranges
Classic STL algorithms, numeric algorithms, projections, iterators, and modern range views in one focused reference.
C++ Algorithms and Ranges
Classic STL algorithms, numeric algorithms, projections, iterators, and modern range views in one focused reference.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
<algorithm>find, find_if, binary_search, lower_bound, upper_boundsort, stable_sort, partial_sort, nth_elementpartition, stable_partitioncopy, move, transform, replace, fill, remove, uniqueset_union, set_intersection, make_heap, push_heap, pop_heap<numeric>accumulatereducetransform_reduceadjacent_differencegcd, lcmstd::ranges::sort(users, std::greater<>{}, &User::score);
<ranges>filtertransformtakedropsplitkeysvalues#include <ranges>
#include <vector>
int main() {
std::vector<int> values{1, 2, 3, 4};
auto even = values | std::views::filter([](int value) { return value % 2 == 0; });
return *even.begin();
}