search. McGraw-Hill The Complete Reference Fourth Edition
โฆษณา
โฆษณา
854
C + + : T h e C o m p l e t e R e f e r e n c e
The rotate_copy( ) algorithm copies the range specified by start and end, storing the result in result. In the process it left-rotates the elements so that the element specified by
mid becomes the new first element. It returns an iterator to the end of result.
search
template <class ForIter1, class ForIter2>
ForIter1 search(ForIter1 start1, ForIter1 end1,
ForIter2 start2, ForIter2 end2); template <class ForIter1, class ForIter2, class BinPred>
ForIter1 search(ForIter1 start1, ForIter1 end1,
ForIter2 start2, ForIter2 end2, BinPred pfn);
The search( ) algorithm searches for a subsequence within a sequence. The sequence being searched is defined by start1 and end1. The subsequence being searched is specified by start2 and end2. If the subsequence is found, an iterator to its beginning is returned.
Otherwise, end1 is returned.
The second form allows you to specify a binary predicate that determines when one element is equal to another.
search_n
template <class ForIter, class Size, class T>
ForIter search_n(ForIter start, ForIter end,
Size num, const T &val); template <class ForIter, class Size, class T, class BinPred>
ForIter search_n(ForIter start, ForIter end,
Size num, const T &val, BinPred pfn);
The search_n( ) algorithm searches for a sequence of num elements equal to val within a sequence. The sequence being searched is defined by start1 and end1. If the subsequence is found, an iterator to its beginning is returned. Otherwise, end is returned.
The second form allows you to specify a binary predicate that determines when one element is equal to another.
set_difference
template <class InIter1, class InIter2, class OutIter>
OutIter set_difference(InIter1 start1, InIter1 end1,
ดาวน์โหลด
โฆษณา