[thread] Using lambda with unique_future

Hi all,
I'm toying around with futures and I'm stumbling with the Visual
Studio 2010 compiler.
The following doesn't compile:
#include <iostream>
#include

AMDG On 03/05/2013 12:16 PM, Christian Henning wrote:
I'm toying around with futures and I'm stumbling with the Visual Studio 2010 compiler.
The following doesn't compile:
boost::unique_future<int> the_answer = boost::async( [] () ->int { return 42; } );
the error is:
<snip>
clang works just fine: http://liveworkspace.org/code/1gOYwa$2
Is this a compiler error or am I doing something wrong?
I'd guess that the problem is that boost::result_of doesn't work for C++11 lambdas. clang works because decltype-based result_of is enabled for clang. In Christ, Steven Watanabe
participants (2)
-
Christian Henning
-
Steven Watanabe