Plantilla de función Variadic con expansión de paquete no en el último parámetro
Me pregunto por qué el siguiente código no compila:
struct S
{
template <typename... T>
S(T..., int);
};
S c{0, 0};
Este código no se compila con Clang y GCC 4.8. Aquí está el error con clang:
test.cpp:7:3: error: no matching constructor for initialization of 'S'
S c{0, 0};
^~~~~~~
test.cpp:4:5: note: candidate constructor not viable: requires 1 argument, but 2 were provided
S(T..., int);
^
Me parece que esto debería funcionar, y T debería deducirse como un paquete de longitud 1.
Si las normas prohíben hacer cosas como esta, ¿alguien sabe por qué?