mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-10 08:22:11 +01:00
19 lines
349 B
C++
19 lines
349 B
C++
/*
|
|
* @@name: pra_iterator.1
|
|
* @@type: C++
|
|
* @@operation: compile
|
|
* @@expect: success
|
|
* @@version: omp_3.0
|
|
*/
|
|
#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 //
|
|
}
|
|
}
|