template<typename T> void doSomething(T&& mStuff)
{
auto lambda([&mStuff]{ doStuff(std::forward<T>(mStuff)); });
lambda();
}
Is it correct to capture the perfectly-forwarded mStuff
variable with the &mStuff
syntax?
Or is there a specific capture syntax for perfectly-forwarded variables?
EDIT: What if the perfectly-forwarded variable is a parameter pack?
See Question&Answers more detail:os