find, find_if, find_if_not:寻找满足条件的首个元素
template< class InputIt, class T >
InputIt find( InputIt first, InputIt last, const T& value );
template< class InputIt, class UnaryPredicate >
InputIt find_if( InputIt first, InputIt last, UnaryPredicate p );
template< class InputIt, class UnaryPredicate >
InputIt find_if_not( InputIt first, InputIt last, UnaryPredicate q );
find_end:寻找指定序列的最后一次出现
template< class ForwardIt1, class ForwardIt2 >
ForwardIt1 find_end( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last );
template< class ForwardIt1, class ForwardIt2, class BinaryPredicate >
ForwardIt1 find_end( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last, BinaryPredicate p );
- 返回序列开端的迭代器,若序列为空或没找到则返回
last
find_first_of:在范围[first, last)
中寻找属于[s_first, s_last)
的首个元素
template< class InputIt, class ForwardIt >
InputIt find_first_of( InputIt first, InputIt last, ForwardIt s_first, ForwardIt s_last );
template< class InputIt, class ForwardIt, class BinaryPredicate >
InputIt find_first_of( InputIt first, InputIt last, ForwardIt s_first, ForwardIt s_last, BinaryPredicate p );
adjacent_find:寻找首对连续的相同(或满足某种关系的)元素
template< class ForwardIt >
ForwardIt adjacent_find( ForwardIt first, ForwardIt last );
template< class ForwardIt, class BinaryPredicate>
ForwardIt adjacent_find( ForwardIt first, ForwardIt last, BinaryPredicate p )
search:搜索子序列
template< class ForwardIt1, class ForwardIt2 >
ForwardIt1 search( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last );
template< class ForwardIt1, class ForwardIt2, class BinaryPredicate >
ForwardIt1 search( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last, BinaryPredicate p );
- 返回子序列开端的迭代器,若没找到则返回
last
- 若子序列为空,则返回
first
search_n:搜索满足条件的多个连续元素
template< class ForwardIt, class Size, class T >
ForwardIt search_n( ForwardIt first, ForwardIt last, Size count, const T& value );
template< class ForwardIt, class Size, class T, class BinaryPredicate >
ForwardIt search_n( ForwardIt first, ForwardIt last, Size count, const T& value, BinaryPredicate p );
- 返回子序列开端的迭代器,若没找到则返回
last
- 若
count
为零或负,则返回first