I understand that given the expression that initializes the reference / universal link, lvalues ββare inferred of type T & and r values ββof type T (not T &).
Thus, to allow only rvalues, you need to write
template<class T, enable_if<not_<is_lvalue_reference<T> >,OtherConds... > = yes> void foo(T&& x) {}
and not
template<class T, enable_if<is_rvalue_reference<T>,OtherConds... > = yes> void foo(T&& x) {}
My question is, why are rvalues ββof type T displayed instead of T&& referral links? I think if they are derived as T && then the same link folding rule also works as T&& && is the same as T&& .
source share