Translations of this page?:

search_n

Syntax:

    #include <algorithm>
    forward_iterator search_n( forward_iterator start, forward_iterator end, SIZE num, const TYPE& val );
    forward_iterator search_n( forward_iterator start, forward_iterator end, SIZE num, const TYPE& val, BinPred p );

The search_n() function looks for num occurances of val in the range [start,end).

If num consecutive copies of val are found, search_n() returns an iterator to the beginning of that sequence. Otherwise it returns an iterator to end.

If the optional binary predicate p is given, then it is used to perform comparisons between elements.

This function runs in linear time.

Related Topics: find_end, find_if, search

 
• • • IndexRecent changesRSScc