Skip to content

Commit

Permalink
Update 5.RRefMovSemPerfForw/item28.md
Browse files Browse the repository at this point in the history
Co-authored-by: Yi Yang <1948638989@qq.com>
  • Loading branch information
standback and y1yang0 committed Sep 30, 2021
1 parent 5aed21b commit 76cfcce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 5.RRefMovSemPerfForw/item28.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ template<typename T>
void func(T&& param);
```
被推导的模板形参`T`将根据被传给`param`的实参为左值还是右值而被编码.
不管传给param的实参是左值还是右值,模板形参`T`都会编码。
编码机制是简单的。当左值实参被传入时,`T`被推导为左值引用。当右值被传入时,`T`被推导为非引用。(请注意不对称性:左值被编码为左值引用,右值被编码为**非引用**。)因此:
Expand Down

0 comments on commit 76cfcce

Please sign in to comment.