I came across an issue last night trying to initialize a vector of futures. I first tried std::fill but I (obviously - in retrospect) cant't assign ‎a float to future<float>. hpx::fill also didn't work. 

I also tried hpx::for_each and hpx::make_ready_future -- it surprised me that this also wouldn't compile. I've yet to fully decipher the compiler error, but I can say that it got stopped by the pseudo-concept / enable_if. I'm not sure which parameter(s) were problematic. 

I expect that an explicit loop will work -- that is shown in the tutorials in the documentation - but was looking for an alternative using a high level algorithm. 

‎It just occurred to me that std::generate might work, though I haven't tried it. 

I suppose I have 2 questions:
1. Is there a canonical way to initialize a vector of futures? 
2. Is there any reason why hpx::fill cannot fill futures - other than lack of specialization? Is it semantically incorrect? If there are no fundamental objections, I'd like to attempt to contribute a patch for this. 

Thanks-
Shmuel


Sent from my BlackBerry 10 smartphone on the Rogers network.
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to