is_permutation
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.
template<class FwdIt1, class FwdIt2> bool is_permutation(FwdIt first1, FwdIt last1, FwdIt first2); template<class FwdIt1, class FwdIt2, class Pr> bool is_permutation(FwdIt first1, FwdIt last1, FwdIt first2, Pr pred);
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).