Rvalue ref and perfect forwarding
Rvalue ref and perfect forwarding
I’ve read few papers about && and I’m just curious if having:
void fnc_1(int&& p) { //... } void fnc(int&& r) { fnc_1(r);//am I suppose to/should I? call it like so:fnc_1(std::forward(r)) }
or just passing ‘r’ is enough?
Answer
fnc_1(r) won’t compile, because ris an lvalue, just like any other variable, regardless of type. Yes, that’s right, named rvalue references are lvalues, not…
View On WordPress















