forhappy / Cplusplus-Concurrency-In-Practice

A Detailed Cplusplus Concurrency Tutorial 《C++ 并发编程指南》
MIT License
5.22k stars 1.49k forks source link

完善forward_value的例子,添加std::forward的使用。 #6

Open abinghu opened 10 years ago

abinghu commented 10 years ago

在move语义的那个例子中,给传递给process_value的参数i进行右值化处理,而使得process_value可以调用右值的版本。当然这里如果参数i是左值的,std::forward是不起任何作用的。