Skip to content

Commit cba5c6c

Browse files
Rholaischangkun
authored andcommitted
fix: typo error (changkun#20)
1 parent 622b5b4 commit cba5c6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/zh-cn/02-usability.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ decltype(x+y) z;
375375
if (std::is_same<decltype(x), int>::value)
376376
std::cout << "type x == int" << std::endl;
377377
if (std::is_same<decltype(x), float>::value)
378-
std::cout << "type z == float" << std::endl;
378+
std::cout << "type x == float" << std::endl;
379379
if (std::is_same<decltype(x), decltype(z)>::value)
380380
std::cout << "type z == type x" << std::endl;
381381
```
@@ -389,7 +389,7 @@ type z == type x
389389

390390
### 尾返回类型推导
391391

392-
你可能会思考,在介绍 `auto`时,我们已经提过类型推导不能用于函数形参,那么`auto` 能不能用于推导函数的返回类型呢?还是考虑一个加法函数的例子,在传统 C++ 中我们必须这么写:
392+
你可能会思考,在介绍 `auto`时,我们已经提过类型推导不能用于函数形参,那么 `auto` 能不能用于推导函数的返回类型呢?还是考虑一个加法函数的例子,在传统 C++ 中我们必须这么写:
393393

394394
```cpp
395395
template<typename R, typename T, typename U>

0 commit comments

Comments
 (0)