Daily bit(e) of C++ | std::next_permutation, std::prev_permutation
Daily bit(e) of C++ #365, The two permutation algorithms: std::next_permutation, std::prev_permutation.
The std::next_permutation and std::prev_permutation algorithms reorder elements of a range into the next/previous lexicographical permutation.
If no such permutation exists, both algorithms roll over and return false.