Standard Range Algorithms C++20Standard Range Algorithms C++20Range Algos
- single range objects (containers/views) can be used as input (before C++20: only iterator pairs)
- input requirements are checked using Concepts
- don't take part in Argument Dependend Lookup (= look up a function in namespaces of its arguments)
Non-Modifying Operations Non-Modifying Non-Mod.
Find Single Elements
Find Consecutive Runs of Equal Elements
Find Subranges
Binary Search of Sorted Ranges Binary Search Binary Search
Copying / Moving / Swapping Elements Copy/Move/Swap Copy/Move
Reordering Elements Reordering Reorder
Legend (Parameter Iconography)
- Introduction & Basic Paradigms
- Function Objects
- Container Traversal
- Minimum / Maximum
- Existence Queries (
count
,any_of
, …) - Finding Elements (
find
,find_if
, …) - Comparing Ranges (
equal
,mismatch
, …) - Sequence Reordering (
reverse
,rotate
, …) - Changing Elements (
replace
,transform
, …) - Removing Elements (
remove_if
,unique
, …) - Sorted Sequence Operations (
binary_search
, …) - Heap Operations (
make_heap
, …)
Related …
- Classic Iterator Pair Algorithms Overview
- Beginner's Guide To C++
- Standard Library Containers
- cppreference: C++20 Constrained Algorithms Library
- cppreference: Classic Algorithms Library
- C++ Standard Algorithms (Video Series) by Conor Hoekstra
C++ Iterators
by Conor Hoekstra- A Tour of C++: Containers and Algorithms