T
will be&
,const &
,&&
orconst &&
according to the value category
T
is never deduced as an rvalue reference. It can be deduced as a non-reference though (for rvalue arguments), possibly const.
I don't know is if
decltype(args)
will resolve to the type "before" or "after" such computation
After, of course.
Which means when (the imaginary) T
is non-reference, decltype
receives T &&
instead. But std::forward
treats T
and T &&
in the same way, so your usage is ok.
Moreover, you don't even need forward
and can just use decltype(args)(args)
(a cast to the decltype
d type), though some prefer to spell out the redundant std::forward
for clarity.