can someone fix my problems. i have no idea what is not working. i got this code with a vector<int>. i only changed this <int> to <vec> and nothing is working anymore.
using namespace std;
//swap
void swap(vec& a, vec& b)
{
vec x = a;
a = b;
b = x;
}
//print the values
void printVector(std::vector<vec>& theVector)
{
for (unsigned int i = 0; i<theVector.size(); i++)
//std::cout << theVector[i] << ",";
std::cout << "\n";
}
//generate values
void generateAllPermutations(std::vector<vec>& toBePermuted, unsigned int nextIndex)
{
if (nextIndex == toBePermuted.size())
{
printVector(toBePermuted);
return;
}
for (unsigned int i = nextIndex; i<toBePermuted.size(); i++)
{
swap(toBePermuted[i], toBePermuted[nextIndex]);
generateAllPermutations(toBePermuted, nextIndex + 1);
swap(toBePermuted[i], toBePermuted[nextIndex]);
}
}