c++ lambdas how to capture variadic parameter pack from the upper scope
问题 I study the generic lambdas, and slightly modified the example, so my lambda should capture the upper lambda's variadic parameter pack. So basically what is given to upper lambda as (auto&&...) - should be somehow captured in [=] block. (The perfect forwarding is another question, I'm curious is it possible here at all?) #include <iostream> #include<type_traits> #include<utility> // base case void doPrint(std::ostream& out) {} template <typename T, typename... Args> void doPrint(std::ostream&