合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
[TOC] ## std::thread 生成多个 ``` #include <functional> #include <iostream> #include <thread> #include <vector> int main() { std::vector<std::thread> t; std::function<void()> f = []() { std::cout << "hello \n"; }; for (int i = 0; i < 10; ++i) { t.push_back(std::thread(f)); } for (auto &thread : t) { thread.join(); } return 0; } ```