Basically I would like to, out of a string, generate all permutations of all possible combinations. For example, "1234" would generate:
1, 2, 3, 4, 12, 13, 14, 21, 23, 24, 31, 32, 34, 41, 42, 43, 123, 124, 132, 134, 142, 143, 213, 214, 234, 234, 241, 243, 312, 314, 321, 324, 341, 342, 412, 413, 421, 423, 431, 432, 1234, 1243, 1324, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 2413, 2431, 3124, 3142, 3214, 3241, 3412, 3421, 4123, 4132, 4213, 4231, 4312, 4321
Is there an algorithm class in C++ which would allow me to do such a thing?