The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

template<class InputIterator1, class InputIterator2>
bool equal(
InputIterator1 _First1,
InputIterator1 _Last1,
InputIterator2 _First2
);
template<class InputIterator1, class InputIterator2, class BinaryPredicate>
bool equal(
InputIterator1 _First1,
InputIterator1 _Last1,
InputIterator2 _First2,
BinaryPredicate _Comp
);

Parameters

_First1

An input iterator addressing the position of the first element in the first range to be tested.

_Last1

An input iterator addressing the position one past the final element in the first range to be tested.

_First2

An input iterator addressing the position of the first element in the second range to be tested.

_Comp

User-defined predicate function object that defines the condition to be satisfied if two elements are to be taken as equivalent. A binary predicate takes two arguments and returns true when satisfied and false when not satisfied.

Return Value

true if and only if the ranges are identical or equivalent under the binary predicate when compared element by element; otherwise, false.

Remarks

The range to be searched must be valid; all pointers must be dereferenceable and the last position is reachable from the first by incrementation.

The time complexity of the algorithm is linear in the number of elements contained in the range.

The operator== used to determine the equality between elements must impose an equivalence relation between its operands.

v1 = ( 0 5 10 15 20 25 )
v2 = ( 0 5 10 15 20 25 )
v3 = ( 0 10 20 30 40 50 )
The vectors v1 and v2 are equal under equality.
The vectors v1 and v3 are not equal under equality.
The vectors v1 and v3 are equal under twice.