Is subject legal (I mean next_permutation, prev_permutation calls) in all cases (accordingly to syntax)? In particular, i don't get what they mean by permutations for iterators for set i.e. a guess only random iterators make sense.
It should be bidirectional, not random access, i.e. it will work for List container. It possibly won't make any sense (and probably won't work) for set (or map), because you cannot se an order of elements.