-
-
Save srinivasyadav18/4fff58ce8b6450ee65ef34e0f4eece88 to your computer and use it in GitHub Desktop.
hpx::ranges
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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