💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[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; } ```