I have a templated function which generates a list of a certain type. For each type the list is formed by an overloaded function. Roughly it looks something like this
void Process(std::vector<Type1> &vector){
}
void Process(std::vector<Type2> &vector){
}
void Process(std::vector<Type3> &vector){
}
template <class T>
std::vector<T> DoFoo() {
std::vector<T> my_vector;
...
Process(my_vector);
...
return my_vector;
}
However now the Process function for Type3 requires a second argument, the rest stays the same. For now I have just added this argument into all 3 of the Process functions but it's ugly and inelegant. Is there a way to implement it better?