
On comp.lang.c++.moderated I talked to Daniel Krügler about how to discover argument and result types from C++11 lambdas in a template context. The thread has the title "How to discover argument and result types from lambda for constructing std::function?"
https://groups.google.com/d/topic/comp.lang.c++.moderated/qaMECIUlJp0...<http://www.google.com/url?sa=D&q=https://groups.google.com/d/topic/comp.lang.c%2B%2B.moderated/qaMECIUlJp0/discussion&usg=AFQjCNGnQG8_tRijTxietu-3OCbw3S-7xQ> The task is to provide a function template "make_function" that takes a C++11 lambda expression and returns a boost::function with the correct signature to call the lambda. This may be extended to accept any other callable type.
The task you are attempting to solve looks very unusual to me. All the usages of a lambda I encountered so far are that you know the type of a callback in advance and define the lambda so that it matches the signature of the targeted callback. Sorry if this question is silly, but could you give me an example of where this deduction mechanism could be used? Regards, &rzej