mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
19 lines
343 B
C
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 //
|
|
}
|
|
}
|