I have been reading about the universal references in Scott's last master piece about the c++11 and 14 with that being said despite an argument assigned to either lvalue or an rvalue type reference parameter there is something in between called universal reference which could deduced to either l/rvalue based on the type trait of an argument that passed . I could understand what makes the parameter as an universal reference but the one thing that doesn't clear to me is why adding const to the type parameter const T&& p
make the p as rvalue:
template<typename T>
void f(T&& param); // param is an universal reference
template<typename T>
void f(const T&& param); // param is an rvalue reference
Does the const
do more than this when assigned to the reference parameter.
const
qualifier is enough to disqualify a reference from being universal" (quote from book, Item 24). – Cooky