Skip to content
New issue

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

pdf(22/377) 页码11页,1.3.3往上第5行的标注疑问的解答 #36

Open
qq184473091 opened this issue Mar 24, 2022 · 2 comments
Open

Comments

@qq184473091
Copy link

当返回类型是auto的时候也是这样(标注:如果是这样,上面的例子中为什么要用std::decay<>呢?)

解答:因为此处的auto仅仅是占位符,实际的返回类型由尾置返回类型明确指定了。

@Walton1128
Copy link
Owner

当返回类型是auto的时候也是这样(标注:如果是这样,上面的例子中为什么要用std::decay<>呢?)

解答:因为此处的auto仅仅是占位符,实际的返回类型由尾置返回类型明确指定了。

感谢,很高兴还有这么仔细读书的人。至少我已经一年多没能仔细读书了。

@LycorisRadiataX
Copy link

LycorisRadiataX commented Oct 9, 2024

但有个问题, 模板的两个类型是值传递声明, 实参为引用的化不是已经退化成不带引用的原始类型了嘛, 这样也不需要使用decay啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants