#include <vector>
#include <algorithm>
std::vector<int> v = { 1,2,3,4,5,6,7,8,9,10 }; // see std::iota also
// important: sort v if not sorted
std::sort(v.begin(), v.end());
while (std::next_permutation(v.begin(), v.end()))
{
// use v (unique permutation)
}
// use v: first sorted position