book: fix the wrong about delctype (#101)

This commit is contained in:
TinyWang
2020-05-30 21:26:10 +08:00
committed by GitHub
parent 0f39561c5a
commit f1c1e06178
2 changed files with 2 additions and 2 deletions

View File

@@ -435,7 +435,7 @@ auto arr = new auto(10); // arr as int *
### decltype
The `decltype` keyword is used to solve the defect that the auto keyword
can only type the variable. Its usage is very similar to `sizeof`:
can only type the variable. Its usage is very similar to `typeof`:
```cpp

View File

@@ -369,7 +369,7 @@ auto arr = new auto(10); // arr 被推导为 int *
### decltype
`decltype` 关键字是为了解决 auto 关键字只能对变量进行类型推导的缺陷而出现的。它的用法和 `sizeof` 很相似:
`decltype` 关键字是为了解决 auto 关键字只能对变量进行类型推导的缺陷而出现的。它的用法和 `typeof` 很相似:
```cpp
decltype(表达式)