64,646
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <ppltasks.h>
using namespace std;
using namespace Concurrency;
int wmain(int argc, wchar_t argv[])
{
task<int> t([](){
wcout << "-1-" << endl;
return 4;
});
t.then([](int n){wcout << "-2-" << endl;}).then([](){wcout << "-3-" << endl; return 2;}).then([](int n){wcout << "-4-" << endl;});
t.then([](int n){wcout << "-2-" << endl;}).then([](){wcout << "-3-" << endl; return 2;}).then([](int n){wcout << "-4-" << endl;}).wait();
system("pause");
return 0;
}