find the number of cores in c++ code example
Example: number of cores c++
#include <thread>
//may return 0 when not able to detect
const auto processor_count = std::thread::hardware_concurrency();
#include <thread>
//may return 0 when not able to detect
const auto processor_count = std::thread::hardware_concurrency();