As far as I can tell, C++0X lambdas on Intel 11.1 Windows do not support the result_type protocols used by result_of (i.e. a nested result_type or a nested result template). See the following code:
It looks like you areusing the std::tr1::result_of from the standard C++ library (their example isnt complete sinceyou dont have an #include of but I think I recreated an example). It looks like thecode doesnt meet the requirements for use with result_of, i.e. look at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1454.html where it says the following below. The lambda/function object has neither a result_type nor a nested result member class template. This is exactly what the diagnostic I am seeing says, i.e.
F:/Program Files/Microsoft Visual Studio 10.0/VC/include/xxresult(28): error: class "lambda (double)->double" has no member "result"
The result_of class template follows the existing practice. It defines a namespace-level class template (result_of) that determines the return type of a function object given the argument types to be passed to that function object, and defines two methods for retrieving the function call operator return type from the function object type: the first uses result_type, for backward compatibility with simple function objects, and the second uses a nested result member class template, for use with more powerful function objects.
I see similar errors from the MSVC++ 2010 compiler.
I think that what I was thinking is that the lambda functors should provide a nested result_type to interface properly with the result_of template? result_of works for both functors and functions and I think is intended to be a uniform way to get at the return type. Since lambdas are currently monomorphic, it seems plausible (and maybe consistent with the C++0X standard? But there I could be completely wrong) for them to play better with this part of the standard library.
Thanks for looking at this.
Perhaps you are right and it is not required... but since so much code is written (in the STL and otherwise) to use the nested typedef of result_type for functors, isn't it a practical requirement for lambdas? And since they are monomoprhic, couldn't the compiler just generate the nested typedef for this with the result_type it already knows? Just a thought as I have had to run through hoops to get the lambdas to work in code that works with every other function and functor type.