35 std::vector<cppext::future_queue<MovableDataType>> q;
36 for(
size_t i = 0; i < 20; ++i) q.emplace_back(10);
39 auto nq = when_all(q.begin(), q.end());
42 std::vector<std::thread> threads;
43 for(
size_t i = 0; i < 20; ++i) {
44 threads.emplace_back([q, i]()
mutable {
45 for(
size_t k = 0; k < 10; ++k) {
48 q[i].push(std::move(x));
54 for(
size_t k = 0; k < 10; ++k) {
56 for(
size_t i = 0; i < 20; ++i) {
57 BOOST_CHECK(q[i].empty() ==
false);
60 BOOST_CHECK_EQUAL(x.
value(), i * 100 + k);
64 BOOST_CHECK(nq.empty() ==
true);
66 for(
auto& t : threads) t.join();