This program illustrates the use of the STL next_permutation() algorithm (default version) to generate all permutations of a vector of integers, in order, and also to demonstrate what happens to the return value of the algorithm when the "end" of a permutation sequence is reached and we then "roll over" to begin a new sequence. Press Enter to continue ... First, we declare a vector of 3 integers and show all of its permuations. Here are the contents of the vector before any permutations are generated: 1 2 3 Press Enter to continue ... And here are the contents of the vector as each permutation is generated: 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 Press Enter to continue ... Finally (for this vector), here are its contents after all permutations have been generated: 1 2 3 Press Enter to continue ... Here are the contents of a second vector of 5 integers before any permutations are generated: 1 3 4 2 5 Press Enter to continue ... Now we show the return value of the algorithm, and the contents of this vector, after each of 6 permutations of just the middle 3 values. Press Enter to continue ... Return value: true Vector contents: 1 4 2 3 5 Return value: true Vector contents: 1 4 3 2 5 Return value: false Vector contents: 1 2 3 4 5 Return value: true Vector contents: 1 2 4 3 5 Return value: true Vector contents: 1 3 2 4 5 Return value: true Vector contents: 1 3 4 2 5 Press Enter to continue ...