Using std::for_each with a lambda to push_back is less efficient than directly constructing the vector. Consider replacing with cpus.assign(cpu_affinity_param_array.begin(), cpu_affinity_param_array.end()); or using the range constructor.
cpus.assign(cpu_affinity_param_array.begin(), cpu_affinity_param_array.end());
Originally posted by @Copilot in #2823 (comment)