From f1c1e061787ce53f0d7c9093766075a0949516e6 Mon Sep 17 00:00:00 2001 From: TinyWang <2746975606@qq.com> Date: Sat, 30 May 2020 21:26:10 +0800 Subject: [PATCH] book: fix the wrong about delctype (#101) --- book/en-us/02-usability.md | 2 +- book/zh-cn/02-usability.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/book/en-us/02-usability.md b/book/en-us/02-usability.md index 7407c75..f7e763f 100644 --- a/book/en-us/02-usability.md +++ b/book/en-us/02-usability.md @@ -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 diff --git a/book/zh-cn/02-usability.md b/book/zh-cn/02-usability.md index 9bd0d05..e5df14b 100644 --- a/book/zh-cn/02-usability.md +++ b/book/zh-cn/02-usability.md @@ -369,7 +369,7 @@ auto arr = new auto(10); // arr 被推导为 int * ### decltype -`decltype` 关键字是为了解决 auto 关键字只能对变量进行类型推导的缺陷而出现的。它的用法和 `sizeof` 很相似: +`decltype` 关键字是为了解决 auto 关键字只能对变量进行类型推导的缺陷而出现的。它的用法和 `typeof` 很相似: ```cpp decltype(表达式)