
On Thu, Sep 20, 2012 at 7:19 AM, Oliver Kowalke <oliver.kowalke@gmx.de>wrote:
I agree that generator<> could get an iterator interface (output-iterator fro caller generator, input-iterator in generator<>-fn) But I'm not convinced that the coroutine<> template should have an iterator interface. How does the syntax look like for coroutine-fn with multiple parameters (for instance f() in the example above)?
you either enable the iterator interface for only coroutine<T()> and coroutine<void(T)>, or, for muliple parameters, you make the value type a tuple: static_assert(is_same<range_value<coroutine<void(int, double, float)> >, std::tuple<int, double, float>); The only coroutines left out from the range interface are general bidirecitonal coroutines of the form coroutine<T...>(T2...)>. -- gpd