What does T&& (double ampersand) mean in C++11?
Hello! I started learning C++11 and came across the new notation `T&&` in code. I understand that `&` is a reference, and `&&` is logical "AND". But in the context of types, it's something else.\n\nFor example, I've seen code like this:\n\n```cpp\ntemplate\nvoid foo(T&& arg) {\n // do something\n}\n```\n\nAnd also:\n\n```cpp\nvoid bar(std::vector&& vec) {\n // ...\n}\n```\n\nAt first I thought that `T&&` is a "reference to a reference", which sounds meaningless. Then I read that it's called an "rvalue reference". But I don't understand why it's needed. What's the difference between `T&` and `T&&`? When should I use `T&&` instead of `T&` or `const T&`? And what is "perfect forwarding" that everyone talks about?\n\nPlease explain with simple examples. I feel like I'm missing something important in modern C++.