Skip to content

Commit 8182184

Browse files
authored
book: typo fixes (changkun#249)
1 parent 237c990 commit 8182184

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

book/en-us/02-usability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ int main() {
222222

223223
In the above code, we can see that the `itr` variable is defined in the scope of
224224
the entire `main()`, which causes us to rename the other when a variable need to traverse
225-
the entire `std::vectors` again. C++17 eliminates this limitation so that
225+
the entire `std::vector` again. C++17 eliminates this limitation so that
226226
we can do this in if(or switch):
227227

228228
```cpp

book/zh-cn/02-usability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ int main() {
182182
}
183183
```
184184

185-
在上面的代码中,我们可以看到 `itr` 这一变量是定义在整个 `main()` 的作用域内的,这导致当我们需要再次遍历整个 `std::vectors` 时,需要重新命名另一个变量。C++17 消除了这一限制,使得我们可以在 `if`(或 `switch`)中完成这一操作:
185+
在上面的代码中,我们可以看到 `itr` 这一变量是定义在整个 `main()` 的作用域内的,这导致当我们需要再次遍历整个 `std::vector` 时,需要重新命名另一个变量。C++17 消除了这一限制,使得我们可以在 `if`(或 `switch`)中完成这一操作:
186186

187187
```cpp
188188
// 将临时变量放到 if 语句内

0 commit comments

Comments
 (0)