In perfect forwarding, std::forward
is used to convert the named rvalue references t1
and t2
to unnamed rvalue references. What is the purpose of doing that? How would that affect the called function inner
if we leave t1
& t2
as lvalues?
template
void outer(T1&& t1, T2&& t2)
{
inner(std::forward(t1), std::forward(t2));
}
No comments:
Post a Comment