I am getting unexpected results from boost::async()
(Boost 1.56, Windows: VS2010 and VS2012).
#include <boost/thread/future.hpp>
...
auto func = [](){ return 123; };
auto boostFut = boost::async(func);
// boostFut = 42; // intentional error to reveal deduced type in compilation error
For some reason boostFut
is deduced as boost::unique_future<void>
instead of boost::unique_future<int>
.
What am I doing wrong?
Note: on VS2012, if I used std::async(func)
instead of boost::async(func)
it does work as expected and the future type is deduced as int
.