Some time ago came across the use of something like this:
template <typename Return, typename ... Args>
struct function_traits<Return(*)(Args......)>{};
Where the above is the variadic expansion of Args, followed by a C style varidic.
Recently on another medium I was discussing this and the other party believed it was still valid to do this:
template <typename Return, typename ... Args>
struct function_traits<Return(*)(Args...,...)>{};
They believed the comma was allowed. But in the past I was forced to use ......, but I don't remember why. It absolutely is on stackoverflow, but it was on an unrelated topic and I couldn't find it again. I do remember something about a MSVC bug which might have forced me to omit the comma.
The question:
Are both forms of the varidic expansion valid in that context, if not why?
Both forms are indeed valid. The relevant part of grammar production is at [dcl.fct]/3
parameter-declaration-clause: parameter-declaration-listopt ...opt parameter-declaration-list , ...
Either way, parameter-declaration-list
can be followed to a production that forms a template parameter pack expansion (that's where the second set of would ...
come from).