File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ decltype(x+y) z;
375375if (std::is_same<decltype(x), int>::value)
376376 std::cout << "type x == int" << std::endl;
377377if (std::is_same<decltype(x), float>::value)
378- std::cout << "type z == float" << std::endl;
378+ std::cout << "type x == float" << std::endl;
379379if (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
395395template <typename R, typename T, typename U>
You can’t perform that action at this time.
0 commit comments