#include <thread> #include <chrono> #include <string> #include <iostream> /* * フツーの関数 */ void global_fun(int n) { using namespace std; cout << "global_fun: " + to_string(n) + " 秒後に終了します...\n"; this_thread::sleep_for(chrono::seconds(n)); cout << "global_fun: おしまい\n"; } /* * ラムダ式 */ auto lambda_exp = [](int n) { using namespace std; cout << "lambda_exp: " + to_string(n) + " 秒後に終了します...\n"; this_thre
![C++11:スレッド・ライブラリひとめぐり【補足編:1】](https://cdn-ak-scissors.b.st-hatena.com/image/square/6aaf02c01a3b99190467478e82843c8b9247d06a/height=288;version=1;width=512/https%3A%2F%2Fcodezine.jp%2Fstatic%2Fimages%2Farticle%2F10580%2F10580_fb.png)