1
0
mirror of https://github.com/OpenMP/Examples.git synced 2025-04-10 16:32:11 +01:00
OpenMP-Examples/sources/Example_pra_iterator.1.cpp

19 lines
343 B
C++

/*
* @@name: pra_iterator.1c
* @@type: C++
* @@compilable: yes
* @@linkable: no
* @@expect: success
*/
#include <vector>
void iterator_example()
{
std::vector<int> vec(23);
std::vector<int>::iterator it;
#pragma omp parallel for default(none) shared(vec)
for (it = vec.begin(); it < vec.end(); it++)
{
// do work with *it //
}
}