-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Labels
Description
第一章中的模板展开为什么不使用通俗易懂的方式让新晋模板选手可以更好的理解呢?
第一章内容如下:
template<typename...Args>
void print(const Args&...args){
int _[]{ 0, (std::cout << args << ' ' ,0)... };
}更改通俗易懂的代码示例:
template<typename T>
void print(T& t){
cout<<t<<endl;
}
template<typename...Args>
void print(const Args&...args){
(cout<<...<<args);
}这样的代码难道不比上面多声明一个数组的方式更好吗?
Reactions are currently unavailable