#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;
}
I2luY2x1ZGUgPG1lbW9yeT4KI2luY2x1ZGUgPGZ1dHVyZT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVCwgdHlwZW5hbWUgV29yaz4Kdm9pZCBUZXN0MihmdXR1cmU8VD4gZiwgV29yayB3KQp7CiAgYXN5bmMoW10oZnV0dXJlPFQ+ICYmIGYsIFdvcmsgdykKICAgICAgICAgICAgICAgICAgICAgIHt9LCBtb3ZlKGYpLCBtb3ZlKHcpKTsKfQoKaW50IG1haW4oKQp7CiAgZnV0dXJlPGludD4geCA9IHN0ZDo6YXN5bmMoW10oKS0+aW50ewogICAgICAgIHN0ZDo6dGhpc190aHJlYWQ6OnNsZWVwX2ZvcihzdGQ6OmNocm9ubzo6bWljcm9zZWNvbmRzKDIwMCkpOwogICAgICAgIHJldHVybiAxMDsKICAgIH0pOwoKICBUZXN0MihzdGQ6Om1vdmUoeCksIFtdKGludCB4KXt9KTsKICAgIHJldHVybiAwOwp9