i\'m new in c++ programing and need some help to use a thread library with vector library...
first I follow this tutorial
but the compiler (visual studio 2013) s
Try this:
#include #include #include // ... int numThreads = 10; std::vector workers; for (int i = 0; i != numThreads; ++i) { workers.emplace_back(calcIterThread, std::ref(res), inicia, fin, i); } for (auto & t : workers) { t.join(); }