Perhaps I being naive here, but I believe the following code should compile:
template <typename ... T>
struct Test {
std::tuple<T> foo;
};
int main() {
struct Test<int, long> test;
return 0;
}
Instead g++ complains:
test.cpp:5: error: parameter packs not expanded with '...':
test.cpp:5: note: 'T'
What am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…