multithreading - Iterate on a vector of promise in C++ -


i'm quite new c++ multithreading , i'm trying handle vector of promise when thing @ end of main:

  (promise<bool> pr : vect){         pr.get_future().get();     } 

the compiler gives me error. how should iterate in vector?

std::promise not copyable, , range-based trying make copies of vector members. need use reference when iterating in way:

for (promise<bool>& pr : vect) { ... } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -