Cast lambda to std::function with parameter pack
问题 There are several questions on SO that relate to casting lambdas to std::function s, but I have yet to see one that uses a parameter pack for the argument list. This seems broken on my version of g++ (7.1.1-4), and possibly it's just not supported. So is this legal c++17 (by the standard)? If not, why? #include <functional> template <typename TReturn, typename ... TArgs> void Functor(std::function<TReturn (TArgs...)> f) {} int main(int argc, char * argv[]) { auto x = [] (int a, int b) {