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
int main()
{
boost::unique_future<int> the_answer = boost::async( [] () ->int {
return 42; } );
std::cout << the_answer.get() << std::endl;
return 0;
}
the error is:
1>c:\gil_contributions\sdl_test\async_test.cpp(9): error C2440:
'initializing' : cannot convert from 'boost::unique_future<R>' to
'boost::unique_future<R>'
1> with
1> [
1> R=void
1> ]
1> and
1> [
1> R=int
1> ]
1> No constructor could take the source type, or constructor
overload resolution was ambiguous
clang works just fine:
http://liveworkspace.org/code/1gOYwa$2
Is this a compiler error or am I doing something wrong?
Thanks,
Christian