chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.81k stars 1.2k forks source link

Feature Request: Allow customizing how to collect results of ranged_parallel_group #1278

Open erinacio opened 1 year ago

erinacio commented 1 year ago

Asio 1.25.0 introduced ranged_parallel_group along with the overload of make_parallel_group that takes a dynamic range of async ops. For now, the ranged_parallel_group collects results of parallel ops into two/three std::vectors, which may not be the best choice under any circunstances. It would be better to allow users using other containers for collecting results. One may use absl::InlinedVector to avoid dynamic memory allocation if possible, or may write a special container which discards any value put into it to explicitly discard async ops results.