In this expression
(void)int[]{0, (std::forward<Ts>(ts)(), 0)...};
You are trying to use functional notation to create a temporary array. This will not work, because the language allows the use of functional notation only using a simple type specifier or a typename specifier.
From [expr.type.conv] / 3
Similarly, the simple-type-specifier or typename-specifier, followed by the braced-init-list, creates a temporary object of the specified type with a direct initialization list (8.5.4) with the specified braced-init-list, and its value is that the temporary object is like a prvalue.
And if you move on to defining a simple specifier type in [dcl.type.simple] , it does not contain anything with array brackets. In fact, it does not even contain anything more than one word. This is why the int(1) entry is valid, but signed int(1) not.
So, with C ++ 11/14 you need to typedef or declare an array variable. But with the C ++ 1z compiler, you can use bend expressions and avoid both
template<typename... Ts> void expander(Ts&&... ts) { (void(std::forward<Ts>(ts)()), ...); }
Live demo
source share