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