2014-07-04 22:27 GMT+08:00 Nat Goodspeed
On Fri, Jul 4, 2014 at 2:28 AM, Mueller-Roemer, Johannes Sebastian
wrote: Sorry for the misunderstanding, the part in the parentheses was meant to point out that I currently do not require bidirectional data flow, so I don't have a use case for that ;)
I do understand that. My question was directed more to the mailing list in general. I'm content with unidrectional coroutine data flow until someone surfaces a compelling use case for bidirectional.
The auto& is not the issue and works just fine in the BOOST_COROUTINES_V1 case (and if it were, it would be a compiler bug as auto& must match std::string const &).
Could it be a compiler bug anyway? The following works fine with gcc 4.2:
#include
#include <iostream> void coro_fn(boost::coroutines::coroutine
::push_type& sink) { sink("Hello world!\n"); } int main(int argc, char *argv[]) { boost::coroutines::coroutine
::pull_type coro(coro_fn); std::cout << coro.get() << std::endl; return 0; }
Call coro() and you'll see the error. Seems that the specializations of pull_coroutine_base and pull_coroutine_object for R& is unnecessary and erroneous.