Standard Library Algorithms Standard Algorithms Algorithms
New to C++'s standard library algorithms? ⇒ Short Introduction
C++20 variants taking single range object as inputsNon-Modifying Operations Non-Modifying Non-Mod.
Binary Search of Sorted Ranges Binary Search Binary Search
min/max/minmax/clamp
min(a, b) →
a if (a < b) is true, b otherwise
min(a, b, f(o,o)→bool) →
a if f(a,b) is true, b otherwise
max(a, b) →
b if (a < b) is true, a otherwise
max(a, b, f(o,o)→bool) →
b if f(a,b) is true, a otherwise
minmax(a, b) →
{ smallest , largest }
minmax(a, b, f(o,o)→bool) →
{ smallest , largest }
minmax({v1,v2,v3, …}) →
{ smallest , largest }
C++11
custom comparison function/object: f(a,b)
must return true if a should be ordered before b
Copying / Moving / Swapping Elements Copy/Move/Swap Copy/Move
Reordering Elements Reordering Reorder
Numeric Operations Numeric Operations Numeric
Range & Iterator Utilities Range Utilities Utilities
Legend (Parameter Iconography)
Overview Sheet (click/zoom)
- 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, …) - Numeric Algorithms (
accumulate,iota, …) - Sorted Sequence Operations (
binary_search, …) - Heap Operations (
make_heap, …) - Random Number Generation
Comments…