Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - #include <hpx/hpx.hpp>
 - #include <hpx/hpx_init.hpp>
 - #include <hpx/include/future.hpp>
 - #include <hpx/include/hpxr.hpp>
 - #include <hpx/include/util.hpp>
 - #include <atomic>
 - #include <iostream>
 - #include <stdexcept>
 - int x = 0;
 - int deep_thought(int& a)
 - {
 - if(x == 4)
 - return a;
 - a++;
 - x++;
 - throw std::exception();
 - }
 - int hpx_main(boost::program_options::variables_map& vm)
 - {
 - int x = 5;
 - auto f = hpxr::async_replay(5, deep_thought, std::ref(x));
 - std::cout << f.get() << std::endl;
 - return hpx::finalize();
 - }
 - int main(int argc, char* argv[])
 - {
 - return hpx::init();
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment