mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-17 12:44:40 +03:00
book: fix the wrong about delctype (#101)
This commit is contained in:
@@ -369,7 +369,7 @@ auto arr = new auto(10); // arr 被推导为 int *
|
||||
|
||||
### decltype
|
||||
|
||||
`decltype` 关键字是为了解决 auto 关键字只能对变量进行类型推导的缺陷而出现的。它的用法和 `sizeof` 很相似:
|
||||
`decltype` 关键字是为了解决 auto 关键字只能对变量进行类型推导的缺陷而出现的。它的用法和 `typeof` 很相似:
|
||||
|
||||
```cpp
|
||||
decltype(表达式)
|
||||
|
||||
Reference in New Issue
Block a user