Skip to content

Commit

Permalink
Refactor of when_all() and when_all_ready().
Browse files Browse the repository at this point in the history
- Now supports when_all()/when_all_ready() on a std::vector of
  arbitrary awaitables.
- Changed when_all() to use an fmap() composition with result
  of when_all_ready() awaitable to extract the results from the
  when_all_task objects.
  This has the side-effect of meaning that
  'co_await lvalueWhenAllAwaitable' now returns a prvalue result
  rather than an lvalue-reference to the result.
  However, the prvalue tuple/vector will contain a copy of the
  results if awaiting an lvalue (allowing you to await it again
  and get another copy) whereas if you co_await an rvalue awaitable
  then the results will be moved into the tuple/vector.
- Re-added support for passing std::reference_wrapper-wrapped
  awaitables to when_all().
- Renamed when_all_awaitable_counter to when_all_counter.
- Removed when_all_awaitable/when_all_awaitable2 as they are no
  longer needed. Everything is built on when_all_ready_awaitable.
  • Loading branch information
lewissbaker committed Oct 3, 2017
1 parent 72d08e0 commit c2576ad
Show file tree
Hide file tree
Showing 10 changed files with 347 additions and 458 deletions.
59 changes: 0 additions & 59 deletions include/cppcoro/detail/when_all_awaitable.hpp

This file was deleted.

164 changes: 0 additions & 164 deletions include/cppcoro/detail/when_all_awaitable2.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions include/cppcoro/detail/when_all_counter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ namespace cppcoro
{
namespace detail
{
class when_all_awaitable_counter
class when_all_counter
{
public:

when_all_awaitable_counter(std::size_t count) noexcept
when_all_counter(std::size_t count) noexcept
: m_count(count + 1)
, m_awaitingCoroutine(nullptr)
{}
Expand Down

0 comments on commit c2576ad

Please sign in to comment.