mirror of
https://github.com/CnTransGroup/EffectiveModernCppChinese.git
synced 2025-03-13 18:50:24 +08:00
fix a typo in item 28
This commit is contained in:
parent
00cac2e48d
commit
0c8090523b
@ -144,7 +144,7 @@ T&& forward(remove_reference_t<T>& param)
|
|||||||
Widget widgetFactory(); //返回右值的函数
|
Widget widgetFactory(); //返回右值的函数
|
||||||
Widget w; //一个变量(左值)
|
Widget w; //一个变量(左值)
|
||||||
func(w); //用左值调用func;T被推导为Widget&
|
func(w); //用左值调用func;T被推导为Widget&
|
||||||
func(widgetFactory()); //用又值调用func;T被推导为Widget
|
func(widgetFactory()); //用右值调用func;T被推导为Widget
|
||||||
```
|
```
|
||||||
|
|
||||||
在auto的写法中,规则是类似的。声明
|
在auto的写法中,规则是类似的。声明
|
||||||
|
Loading…
Reference in New Issue
Block a user