Temporary return?

Started by
13 comments, last by Inmate2993 18 years, 8 months ago
interesting article full asymmetric coroutines
Advertisement
Nup, not that.. That's right Nitage, that's what I'm after.
It has already been pointed out twice: you want coroutines.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
That's basically what fibers do. (Fibers: win32 coroutines.)
State Machine would work just as well.
void thing( bool init ){  static int state;  if (init) state = -1;  state += 1;  switch (state)  {    case 0:      dosomething();      return;    case 1:      dosomethingelse();      return;    default:      return;  }}
william bubel

This topic is closed to new replies.

Advertisement