Skip to content

Instantly share code, notes, and snippets.

@srinivasyadav18
Created March 13, 2021 07:37
Show Gist options
  • Save srinivasyadav18/4fff58ce8b6450ee65ef34e0f4eece88 to your computer and use it in GitHub Desktop.
Save srinivasyadav18/4fff58ce8b6450ee65ef34e0f4eece88 to your computer and use it in GitHub Desktop.
hpx::ranges
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <boost/range/irange.hpp>
#include <iostream>
int hpx_main()
{
std::cout << "HPX VC test\n";
hpx::execution::dataseq_policy dataseq;
auto range = boost::irange(0, 10);
for (auto i : range)
{
std::cout << i << "\t";
}
std::cout << "\n";
hpx::ranges::for_each(range, [&](int i){
i += 5;
std::cout << i << "\t";
});
std::cout << "\n";
for (auto i : range)
{
std::cout << i << "\t";
}
return hpx::finalize();
}
int main(int argc, char* argv[])
{
return hpx::init(argc, argv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment