C++/stl
<algorithm> mismatch
홍서의
2020. 12. 29. 21:11
// 파일이름: stl_algobase.h
template<typename InputIterator1, typename InputIterator2,
typename BinaryPredicate>
pair<InputIterator1, InputIterator2>
mismatch(InputIterator1 first1, InputIterator2 last1,
InputIterator2 first2, BinaryPredicate binary_pred)
{
while ( first1 != last1 && binary_pred(first1, first2))
{
++first1;
++first2;
}
return pair<InputIterator1, InputIterator2>(first1, first2);
}
여기서 파라미터 binary_pred를 생략하면 predicate는 equal버전으로 호출한다.