So, you want to learn about std::thread
added in C++11? This will include that and a small bit on lambdas, which were also added.
note: all code samples assume that <thread>
, <iostream>
, and (later) <future>
have been included.
// both threads will run this
void printThreadNum(int num) {