#include <iostream>
#include <thread>

void call_from_thread() {
    std::cout << "Hello, World" << std::endl;
}

int main() {
    //Launch a thread
    std::thread t[5];

    for(int i = 0; i < 5; i++){
      t[i] = std::thread(call_from_thread);
    }

    for(int i = 0; i < 5; i++){
      t[i].join();
    }

    return 0;
}


#include <thread>
#include <iostream>
#include <vector>

void hello(){
    std::cout << "Hello, world" << std::endl;
}

int main(){
    std::vector<std::thread> threads;

    for(int i = 0; i < 5; ++i){
        threads.push_back(std::thread(hello));
    }

    for(auto& thread : threads){
        thread.join();
    }

    return 0;
}

Make c++11 example more realistic
Make c++11 example more realistic
