C++ Logo

std-discussion

Advanced search

Forwarding References from Variable Template

From: Deslauriers, Douglas <Douglas.Deslauriers_at_[hidden]>
Date: Thu, 12 Mar 2026 20:45:23 +0000
Hello,

I was reading the section for _forwarding references_
https://timsong-cpp.github.io/cppwp/temp.deduct.call#3

> A forwarding reference is an rvalue reference to a cv-unqualified
> template parameter that does not represent a template parameter of a
> class template (during class template argument deduction
> ([over.match.class.deduct])).

And was wondering if that made the parameter "t" a forwarding reference
in the following example, despite the fact that its template parameter
is that of a variable template.

template<typename T>
auto var = [](T&& t) { std::forward(t); };

Did the standard intend for this to be the case?

Regards,
Douglas Deslauriers

Received on 2026-03-12 20:45:30