Why there is no specific type allowed in a variadic template pack?
template< typename T >
class Foo
{
public:
template< typename... Values >
void bar( Values... values )
{
}
template< T... values > <-- syntax error
void bar( T... values )
{
}
template< int... values > <-- syntax error
void bar( int... values )
{
}
};
Whats the rationale in not allowing this?
Are there proposals for this?
Note: alternatives would be
std::initializer_list< T >
without narrowing of types and the{ }
-brace-syntax- a (ugly) recursive trait that checks all types seperately: see here