I was writing a function template as
template<typename ...T>
void f(T ...t) {
X x(t...);
// ...
}
When I was looking at it, I was wondering what happens for a call f(). Will vexing parse make x a function declaration? Compilers seem to make it a variable. Can someone help me be sure about it please?
The empty parenthesis (
()) will make it a function declaration only if it’s written as such in the source code.§14.5.3 [temp.variadic] p6also mentions this:See specifically the second comment in the example code.