Is it possible in C++11 to combine functions into a new function?
问题 This is more a kind of theoretical question. Is it possible in C++11 to combine functions into a new function? For example : auto f = [](int i){return i * 2;}; auto g = [](int i){return i + 10;}; So this works: auto c = f(g(20)); // = 60 But I want an object that stores the combination, like auto c = f(g); std::cout << c(20) << std::endl; //prints 60 Edit: Additionally what i want to create is a function a, which you can give a function b and an int n , and which returns the n'th combination