Try
#include <iostream>
#include <vector>
using namespace std;
template <typename T>
void passarray(vector<T> & myvec, T value)
{
myvec.push_back(value);
}
template <typename T>
void givevalue(vector <T> & v){}
template <typename T, typename... Ts>
void givevalue(vector<T> & v, T x, Ts... xs)
{
passarray(v, x);
givevalue(v, xs...);
}
int main()
{
vector<int> myvec {12,7};
givevalue(myvec, 5, 6, 7);
givevalue(myvec, 42);
for (auto x : myvec)
cout << x << " ";
cout << endl;
}