Determines whether the elements in a given range form a valid permutation. A permutation is a series of elements in which all of the elements that test true for a condition precede elements that return false.
The first template function assumes that there are as many elements in the range beginning at first2 as there are in the range designated by [first1, last1). It returns true only if, for each element X in the range designated by [first1, last1) there are as many elements Y in the same range for which X == Y as there are in the range beginning at first2. Here, operator== must perform a pairwise comparison between its operands.
The second template function behaves the same, except that it replaces operator==(X, Y) with pred(X, Y).