Boost logo

Boost :

Subject: Re: [boost] [yield_iterator] new iterator lib with C# yield return/yield break
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2011-06-21 03:52:49

> Where do you store the stack with regard to the iterator?

because the iterator does the context switch (each time the iterator is incremented it jumps back to 'void iterate()' function)
the context jump is handled by context aggregated inside yield_adapter hence yield_iterator.

> Iterators need to be copyable, so you can't just store it in the
> iterator itself.

It would be a limitation that copying the iterator let point it to the same yield_adapter. the reason is that the context class is not copyable only movrable.

> Your operator== seems incorrect, it compares the values, and does very
> weird things with null values.

because the code uses pointers to transfer the address of the object wich should be dereferenced by the iterator (the address it transfered between the context switches). End of iteration is indicated by NULL poitners.

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro!

Boost list run by bdawes at, gregod at, cpdaniel at, john at