I am trying to push_back the parameters of a variadic function as shown below, but the compiler says there is a type mismatch (due to the parameters being a general type while the vector is int). What should I do to make the parameters compatible?
vector<int> x;
template<typename... Rest>
void foo(Rest... rest) {
x.push_back(rest...);
}