Quote Originally Posted by henryswanson View Post
I've tried using that, but it's far too slow. I think that might be because it produces things in a strict order.
And maybe because you're not timing an optimized build of your program, and instead timing a "debug" or non-optimized version of the program.

Secondly, a simple question -- did the next_permutation() work? If it did, and the speed is acceptable, what is the issue? In your example, 5! == 120, IMO hardly anything to worry about.

If you're looking for combinations and not permutations, then see my contribution to the thread below:

http://www.codeguru.com/forum/showthread.php?t=241675

Regards,

Paul McKenzie