title: C++ algorithm for N! orderings
body: <p>I have a list of N items and I am wondering how I can loop through the list to get every combination.  There are no doubles, so I need to get all N! orderings.  Extra memory is no problem, I'm trying to think of the simplest algorithm but I'm having trouble.</p>