Skip to content

combination in parallel with std for_each #12

@remz1337

Description

@remz1337

Hello,

I have to iterate over 5 billions+ combinations so I would like to do it in parallel using the STL for_each loop with parallel execution, but I get an error saying Parallel algorithms require forward iterators or stronger

auto comb = discreture::combinations(_population, 2);

std::for_each(std::execution::par, comb.begin(), comb.end(), [&](auto i) {
	DoStuff();
});

Anyway I could make it work with STL for_each?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions