Efficiently Generate Subset of all Permutations or Combinations with and without Repetition (C++)
I'm going to focus on the algorithmic aspects of your code rather than the style, as I don't know C++. You want to generate permutations and combinations with unique elements, so all you need to do is find the sublist of unique elements, and find the permutations and combinations of that. To uniquify, you should use a structure with a fast contains method (tree or hash set), and add each element is the vector to it if it isn't already. This will use O(n) memory, but your output is much later, so that overhead is justified given that it will save a lot of time later.