Is there a difference between universal references and forwarding references?

Do they mean the same thing? Universal reference was a term Scott Meyers coined to describe the concept of taking an rvalue reference to a cv-unqualified template parameter, which can then be deduced as either a value or an lvalue reference. At the time the C++ standard didn’t have a special term for this, which … Read more

What does auto&& tell us?

By using auto&& var = <initializer> you are saying: I will accept any initializer regardless of whether it is an lvalue or rvalue expression and I will preserve its constness. This is typically used for forwarding (usually with T&&). The reason this works is because a “universal reference”, auto&& or T&&, will bind to anything. … Read more