Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <execution>
- using namespace std;
- int main() {
- std::vector<int> from_vector(10);
- std::iota(from_vector.begin(), from_vector.end(), 0);
- std::vector<int> to_vector(10);
- auto tmp = std::copy_if(execution::parallel_policy, from_vector.begin(), from_vector.end(),
- std::back_inserter(to_vector),
- [](int x) { return x % 2 == 0; });
- to_vector.resize(std::distance(to_vector.begin(), tmp));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment