If the two sequences are not equal, std::is_permutation may be O(N^2)
and indeed the case in libstdc++ and libc++. Use SmallPtrSet just into prevent
pessimizing cases. On my machine, SmallPtrSet starts to outperform
casestd::is_permutation when there are 16 elements.