Modernes C++ programmieren

Okt 20, 2024

lst-0005-book.cpp

// https://godbolt.org/z/Tzs93MzfK 
std::thread myThread{ [] {  // pure thread
    task1();
    task2();
    task3();
} };
myThread.join();   // waits for the thread to finish