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
Post a Comment