With coroutines defined as of http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4628.pdf and implemented in VS2015/Update 3, how can a generator invoke a function that emits values on its behalf?
Clarifying example
I would like to write code as follows...
static void yield_for_me()
{
co_yield 27; // does not compile
// co_yield relies on hidden definitions
}
std::experimental::generator<int> testf()
{
yield_for_me();
co_yield 28;
}
...in hopes that it will have the exact same outcome as the following code:
std::experimental::generator<int> testf()
{
co_yield 27;
co_yield 28;
}
yield from
-- hopefully they implement something similar in c++ :)