mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-18 05:04:39 +03:00
revision: #1 更新目录
This commit is contained in:
@@ -444,7 +444,7 @@ std::cout << "q: " << q << std::endl;
|
||||
|
||||
`decltype(auto)` 是 C++14 开始提供的一个略微复杂的用法。
|
||||
|
||||
> 要理解它你需要知道 C++ 中参数转发的概念,我们会在[语言运行时强化]()一章中详细介绍,你可以到时再回来看这一小节的内容。
|
||||
> 要理解它你需要知道 C++ 中参数转发的概念,我们会在[语言运行时强化](./3-runtime)一章中详细介绍,你可以到时再回来看这一小节的内容。
|
||||
|
||||
|
||||
简单来说,`decltype(auto)` 主要用于对转发函数或封装的返回类型进行推导,它使我们无需显式的指定 `decltype` 的参数表达式。考虑看下面的例子,当我们需要对下面两个函数进行封装时:
|
||||
|
||||
Reference in New Issue
Block a user