1

I met a piece of code below and get lost:

template<typename T>
T add(T t, T u)
{
    return t + u;
}

template<typename ... T>
std::vector<int> add_values(int value, T ... t)
{
    return{ add(t, value)... }; //what does this ... mean?
} 

int main()
{
    add_values(4); 

    return 0;
}

I can understand that the typename ... T means a series of types, and T ... t means a series of T1 t1, T2 t2 .... parameters. But what does the ... in the return{ add(t, value)... } line mean?

athos
  • 6,120
  • 5
  • 51
  • 95

0 Answers0