我可以写成
template< class T0> struct Last0
{
using type = decltype(T0{}); // OK compiles. `type = T0`
};
template< class T0, class T1> struct Last1
{
using type = decltype(T0{}, T1{}); // OK, compiles. `type = T1`
};
template< class T0, class T1, class T2> struct Last3{
using type = decltype(T0{}, T1{}, T2{}); // Ok, compiles. `type = T2`
};
但是,当我使用可变参数模板时,它没有被编译:
template< class ... T> struct Last{
using type = decltype(T{} ... ); //<--- Error !!!
};
什么问题?