auto&& var2 = var1; // universal reference template<typename T> void f(T&& param); // universal reference template<class T, class Allocator = allocator<T>> class vector { template <class... Args> void emplace_back(Args&&... args); //args is universal reference }; //------------___________________________
below are not universal reference---- template<typename T> void f(std::vector<T>&& param); // rvalue reference // form is quite constrained.It must be precisely "T&&". template<typename T> void f(const T&& param); // with const template<class T, class Allocator = allocator<T>> // from C++ class vector { // Standards public: void push_back(T&& x); //no type deduction ... };