<分区>
我想要一个可变参数模板类的模板类型的函数参数。下面的代码如何才能合式?
template <typename T>
struct Foo {
typedef T Base;
};
template <typename... Targs>
struct Bar {
void get(Targs::Base... args) {} /// Type of the typedef Base of Foo!
};
int main() {
Bar<Foo<int>, Foo<double>> bar;
int i = 0;
double j = 0.0;
bar.get(i, j);
}
使用 GCC 4.9 C++11 或 5.3。