1. std::find
用法:std::find(iter_fisrt, iter_end, value)
value的类型必须与*iter相同,并且,*iter必须可以作为operator==的输入
概念:寻找相等的结果
2. std::find_if
用法:std::find_if
template <class InputIterator, class UnaryPredicate> InputIterator find_if (InputIterator first, InputIterator last, UnaryPredicate pred);
first, last
Input iterators to the initial and final positions in a sequence. The range used is [first,last)
, which contains all the elements between first and last, including the element pointed by first but not the element pointed by last.
pred
Unary function that accepts an element in the range as argument and returns a value convertible to bool
. The value returned indicates whether the element is considered a match in the context of this function.
The function shall not modify its argument.
This can either be a function pointer or a function object.