The library defines more than 100 algorithms. Learning to use these algorithms effectively requires understanding their structure rather than memorizing the details of each algorithm. Accordingly, in Chapter 10 we concentrated on describing and understanding that architecture. In this section we’ll briefly describe every algorithm. In the following descriptions,
• beg
and end
are iterators that denote a range of elements (§ 9.2.1, p. 331). Almost all of the algorithms operate on a sequence denoted by beg
and end
.
• beg2
is an iterator denoting the beginning of a second input sequence. If present, end2
denotes the end of the second sequence. When there is no end2
, the sequence denoted by beg2
is assumed to be as large as the input sequence denoted by beg
and end
. The types of beg
and beg2
need not match. However, it must be possible to apply the specified operation or given callable object to elements in the two sequences.
• dest
is an iterator denoting a destination. The destination sequence must be able to hold as many elements as necessary given the input sequence.
• unaryPred
and binaryPred
are unary and binary predicates (§ 10.3.1, p. 386) that return a type that can be used as a condition and take one and two arguments, respectively, that are elements in the input range.
• comp
is a binary predicate that meets the ordering requirements for key in an associative container (§ 11.2.2, p. 425).
• unaryOp
and binaryOp
are callable objects (§ 10.3.2, p. 388) that can be called with one and two arguments from the input range, respectively.