# variadic expansion - when and where?

## Recommended Posts

slowcodes    100

template <typename ...Params>void f(Params&&... params){  y(std::forward<Params>(params)...);}

I tried doing this with my own function and it worked.

But what is the general rule for when and where you can use this? Only on lists separated by commas? Or is there a specific list of places where it works?

I can't do
template <typename T>inc(T& t) { t++; }template <typename ...Params>void f(Params&&... params){  inc<Params>(params)...;}

to increment every parameter. What's the cleanest way to do this? I know I could use an intermediary dummy function that does nothing.