I don't know what library you are talking about, but it looks like it accepts iterators:
Concurrency::parallel_for_each(start_iterator, end_iterator, function_object);
And it probably has the same effect as this one (although not necessarily in the same order):
for(sometype i = start_iterator; i != end_iterator; ++i) { function_object(*i); }
For instance:
void do_stuff(int x) { } vector<int> things;
The other takes values, so most likely it has a similar effect (but again, without a guaranteed order):
for(sometype i = start_value; i != end_value; ++i) { function_object(i); }
Try the following:
void print_value(int value) { cout << value << endl; } int main() {
EDIT. You can find confirmation of these actions in Links to parallel algorithms .
source share