thread thread1(); thread::id id1 = thread1.get_id(); if (thread1.joinable()) { thread1.join(); cout << "Thread ID: " << id1 << " ...thread1 executed!" << endl; }