From: Darryl Green (darryl.green_at_[hidden])
Date: 2005-06-03 00:58:53
Maksym Motornyy <mmotorny <at> yandex.ru> writes:
> The same code in C++ (using my library) will look like:
> class simple_generator
> YIELD_BEGIN_WITH_CTOR( simple_generator, int )
> YIELD_FOR_0( i = 1, i < 4, ++i )
> YIELD_FOR_1( j = 1, j < 4, ++j )
> YIELD_RETURN( i * j )
> int i;
> int j;
Nice idea - but a tad ugly.
Have you seen http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
which deascribes a similar approach in C?
I don't actually find this terribly compelling - and it looks like the C#
implementation is just as limited, but at least has nicer syntax than a
macro hack can manage. I would be far more interested in real coroutines.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk