Possible Duplicate:
What does T&& mean in C++0x?
I had never seen a double ampersand before I read this answer.
The code snippet in question is this:
template <typename T>
T& as_lvalue(T&& x)
{
return x;
}
What does &&
achieve? What sorts of parameters can be passed to as_lvalue()
It is called an rvalue reference, and it is new in C++11. It binds to temporaries without making a copy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With