我试图掌握std :: search和std :: find_first_of之间的区别
他们有相同的原型:
template <class ForwardIterator1,class ForwardIterator2> ForwardIterator1 find_first_of (ForwardIterator1 first1,ForwardIterator1 last1,ForwardIterator2 first2,ForwardIterator2 last2); template <class ForwardIterator1,class ForwardIterator2,class BinaryPredicate> ForwardIterator1 find_first_of (ForwardIterator1 first1,ForwardIterator2 last2,BinaryPredicate pred); template <class ForwardIterator1,class ForwardIterator2> ForwardIterator1 search (ForwardIterator1 first1,class BinaryPredicate> ForwardIterator1 search (ForwardIterator1 first1,BinaryPredicate pred);
它们都返回相同的东西:[first1,last1]内第一次出现序列[first2,last2]的迭代器. (使用相等或二元谓词)
那么区别是什么呢 ?我错了吗 ?