
21 Jun
2011
21 Jun
'11
7:41 a.m.
On 21/06/2011 07:19, Oliver Kowalke wrote:
yield_adapter contains a context object which handles register and stack swapping. The stack is stored in the context object too. boost.context could be used as the base of a coroutine implementation (becuase it is more low-level).
That doesn't really answer my question. Where do you store the stack with regard to the iterator? Iterators need to be copyable, so you can't just store it in the iterator itself. So you use an intrusive_ptr to deal with this (which is not thread-safe, by the way). This could cause some problems with comparison. Your operator== seems incorrect, it compares the values, and does very weird things with null values.