
Am 06.10.2012 00:20, schrieb Vicente J. Botet Escriba:
Le 05/10/12 21:46, Oliver Kowalke a écrit :
Am 05.10.2012 21:27, schrieb Vicente J. Botet Escriba:
The single difference between both interfaces is that with fist the return is obtained using yield, while in the second is using the operator().
the main difference between version 1 and 2 is that self_t is not a coroutine<> it is a different type. I don't think the caller should be taken as a coroutine, as it could not be one.
it was one suggestion from Giovanni and Eugene and as Giovanni - I'm undecided which version would be better
Version 2 was suggested by Giovanni and Eugene - especially Eugene has provided an example demonstrating the benefit of version 2:
I prefer to use yield to return a result and the call operator to call to a coroutine. because slef_t is not of type coroutine<> I expressed the context jump function as 'yield()' instead of operator()
It is not enough clear to me what are the advantages of having a inversed coroutine as parameter. If you use symmetric coroutines - see example above Symmetric coroutines are a different thing than your caller_t type, even if the caller is a coroutine. Symmetric coroutines lets the called coroutine to yield in place of the calling one. I don't see how this inversion helps to achieve symmetric coroutines. I should be missing something basic. Of course, I'm completely for the addition of symmetric coroutines.
missunderstanding I'm mean 'symmetric' in the sense of symmetric signature - take a look at Eugene's examples I need some input which version should be used for further development Votes? best, Oliver