All Range Algorithms

All Range Algorithms

A compact scan page for the ranges-based algorithm family that operates directly on ranges and supports projections.

How to use this reference page

Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.

  • Scan the top of the page first to identify the primary types, functions, or algorithm families involved.
  • Use the nearby-page links when your question is really about a companion header, related algorithm family, or broader subsystem.
  • Validate tricky behavior with a small compileable example before relying on memory for details like invalidation, ordering, allocation, or lifetime rules.

All Range Algorithms

Search and query algorithms

Ordering and partitioning algorithms

Copying, transforming, and removal-style algorithms

Heap and set-style algorithms

Practical rules

Example in practice

#include <algorithm>
#include <vector>

int main() {
    std::vector<int> values{7, 2, 5, 1};
    std::ranges::make_heap(values);
    std::ranges::pop_heap(values);
    return values.back();
}