We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第一章中的模板展开为什么不使用通俗易懂的方式让新晋模板选手可以更好的理解呢? 第一章内容如下:
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); }
这样的代码难道不比上面多声明一个数组的方式更好吗?
The text was updated successfully, but these errors were encountered:
@Mq-b
Sorry, something went wrong.
你是不是对 “通俗易懂” 有什么误解?
仅需要先了解下,“副作用”和“逗号表达式”。同时我觉得二元折叠表达式在模板初学者看来并不比形参包展开更通俗易懂。当然什么更易懂本来就是个主观问题。
No branches or pull requests
第一章中的模板展开为什么不使用通俗易懂的方式让新晋模板选手可以更好的理解呢?
第一章内容如下:
更改通俗易懂的代码示例:
这样的代码难道不比上面多声明一个数组的方式更好吗?
The text was updated successfully, but these errors were encountered: