adjacent_find. McGraw-Hill The Complete Reference Fourth Edition
विज्ञापन
विज्ञापन
840
C + + : T h e C o m p l e t e R e f e r e n c e
T he algorithms defined by the standard template library are described here. These algorithms operate on containers through iterators. All of the algorithms are template functions. Here are descriptions of the generic type names used by the algorithms.
Generic Name
BiIter
ForIter
InIter
OutIter
RandIter
T
Size
Func
Generator
BinPred
UnPred
Comp
Represents
Bidirectional iterator
Forward iterator
Input iterator
Output iterator
Random access iterator
Some type of data
Some type of integer
Some type of function
A function that generates objects
Binary predicate
Unary predicate
Comparison function
adjacent_find
template <class ForIter>
ForIter adjacent_find(ForIter start, ForIter end); template <class ForIter, class BinPred>
ForIter adjacent_find(ForIter start, ForIter end, BinPred pfn);
The adjacent_find( ) algorithm searches for adjacent matching elements within a sequence specified by start and end and returns an iterator to the first element. If no adjacent pair is found, end is returned. The first version looks for equivalent elements.
The second version lets you specify your own method for determining matching elements.
binary_search
template <class ForIter, class T> bool binary_search(ForIter start, ForIter end, const T &val);
डाउनलोड
विज्ञापन