auto
is not a type so I’m not surprised this doesn’t work. But can’t you use decltype
?
[](auto&& v) { f(std::forward<decltype(v)>(v)); }(8);
Scott Meyers has more details.
auto
is not a type so I’m not surprised this doesn’t work. But can’t you use decltype
?
[](auto&& v) { f(std::forward<decltype(v)>(v)); }(8);
Scott Meyers has more details.