#include #include using namespace std ; void thread_function() { cout << "thread function\n"; } int main() { thread t1( &thread_function ); // t1 starts running cout << "main thread\n"; t1.join(); // main thread waits for the thread t1 to finish return 0; }