How do you implement Coroutines in C++
I doubt it can be done portably, but are there any solutions out there?  I think it could be done by creating an alternate stack and reseting SP,BP, and IP on function entry, and having yield save IP and restore SP+BP.  Destructors and exception safety seem tricky but solvable.

Has it been done?  Is it impossible?
How do you implement Coroutines in C++
===

I doubt it can be done portably, but are there any solutions out there?  I think it could be done by creating an alternate stack and reseting SP,BP, and IP on function entry, and having yield save IP and restore SP+BP.  Destructors and exception safety seem tricky but solvable.

Has it been done?  Is it impossible?