I installed Visual C++ Compiler November 2012 CTP and created a C++ console project. I wrote this in
template<typename T>
void Test(T value){
}
template<typename T, typename... Args>
void Test(T value, Args... args){
Test(value);
Test(args...);
}
int main(){
Test(1,2,3);
}
Then I pressed F6 to build in the IDE. I got this error on line 4
error C2143: syntax error : missing ',' before '...'
The compile list "variadic templates" so I believe this should work. I do understand intellisense may be incorrect however the 'compiler' should work. Can I not build from the IDE? Do I have to enable something somewhere? int i{4};
doesn't seem to work either and I am sure thats valid uniform initialization.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…