Commit graph

5 commits

Author SHA1 Message Date
Lewis Baker
8e728932be Improvements to fmap() implementation
- Added documentation to README
- Implemented fmap() for generator<T>, recursive_generator<T>,
  shared_task<T>.
- Centralised operator| overloads for fmap() in fmap.hpp.
- Now provide two-argument fmap() overloads as the type-specific
  implementations: fmap(func, value)
  This replaces the need for detail::apply_fmap() functions.
2017-08-19 23:12:34 +09:30
Lewis Baker
e5bf85c5e9 Fix bug in recursive_generator<T> when building under Clang.
The promise_type::get_return_object() method was returning a reference
to the promise object, expecting that reference to be passed to the
constructor of recursive_generator<T>.

However, under Clang the result of get_return_object() is assigned to
an 'auto' variable, which ends up taking a copy of the promise object
on the stack and passing that copy into the recursive_generator<T>
constructor.

Modified get_return_object() to return the already-constructed
recursive_generator<T> object.
2017-07-18 22:03:27 +09:30
Lewis Baker
b1f8f75960 Add traits and operator-> to recursive_generator<T>::iterator. 2017-06-16 22:41:00 +09:30
Lewis Baker
c32cc801b4 Add deleted await_transform() to generator/recursive_generator.
This prevents use of co_await within generator coroutines.
2017-06-16 09:02:28 +09:30
Lewis Baker
6247291b86 Add cppcoro::recursive_generator 2017-06-16 06:42:40 +09:30