I want to generate a set of permutations but not in the ordinary way.
I know that I can use <algorithms> std::next_permutation to generate every single permutation of e.g. [a][b][c][d] -> a,b,c,d -> b,a,c,d ...
But what I want to do is to generate every single permutation where a permutation can include repeats e.g. [a][a][c][d] -> [a][a][a][c] -> [b][b][d][a] etc.
If you know how to convert between numeric bases, you could enumerate all (for your example) 4-digit numbers in base-4 numeric system: (0000, 0001, 0002, 0003, 0010, ... 3333), and substitute the digits for your [a], [b], [c], and [d].