Skip to content

Conversation

@alugowski
Copy link
Owner

For converting loops like this:

// Sequential
for (int i = 0; i < 100 : ++i) {
    std::cout << i;  // loop body
}

To parallel for_each:

// Parallel
using poolstl::iota_iter;

std::for_each(poolstl::par, iota_iter<int>(0), iota_iter<int>(100), [](auto i) {
    std::cout << i;  // loop body
});

@alugowski alugowski merged commit 58d7586 into main Nov 22, 2023
@alugowski alugowski deleted the iota_iter branch November 22, 2023 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants