Capturing perfectly-forwarded variable in lambda
Is it correct to capture the perfectly-forwarded mStuff variable with the &mStuff syntax? Yes, assuming that you don’t use this lambda outside doSomething. Your code captures mStuff per reference and will correctly forward it inside the lambda. For mStuff being a parameter pack it suffices to use a simple-capture with a pack-expansion: template <typename… T> … Read more