equal function template — Tests whether ranges have same contents
template<typename InIter1, typename InIter2> bool equal(InIter1 first1, InIter1 last1, InIter2 first2); template<typename InIter1, typename InIter2, typename BinaryPredicate> bool equal(InIter1 first1, InIter1 last1, InIter2 first2, BinaryPredicate pred);
The equal
function template
returns true
if two ranges
contain the same elements in the same order. The first range is
[first1
, last1
), and the second range has the same
number of elements, starting at first2
. The ranges can overlap.
The first form compares items using the ==
operator. The second form calls
pred(*iter1
, *iter2)
.