void task1(std::string msg) { std::cout << "task1 says: " << msg; } std::thread t1(task1, "Hello"); t1.join();