std :: forward()总是在模板函数中使用吗?

时间:2018-03-16 16:57:34

标签: c++ perfect-forwarding forwarding-reference

任何人都可以给我一个非模板函数定义,显示对std :: forward()的显式调用吗?

我想forward()的参数总是(?)是一个通用引用。通用引用可以声明为“auto”,如

<div class="container">
  <div class="first child">first first first first first first first</div>
  <div class="second child">second second second second second second second second second second second second second second second second second second second</div>
  <div class="third child">third</div>
</div>

使用此var2,非模板函数可以执行:

auto&& var2=var1;

0 个答案:

没有答案