std::async decaying(losing) rvalue reference in Visual Studio 2012 Update 2. Any workarounds?
问题 Consider the below code: #include <memory> #include <future> using namespace std; template <typename T, typename Work> void Test2(future<T> f, Work w) { async([](future<T> && f, Work w) {}, move(f), move(w)); } int main() { future<int> x = std::async([]()->int{ std::this_thread::sleep_for(std::chrono::microseconds(200)); return 10; }); Test2(std::move(x), [](int x){}); return 0; } The above, fails with the following compiler error: Error 1 error C2664: 'void Test2::::operator ()(std::future<