<p>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.</p>

<p>Has it been done?  Is it impossible?</p>

Does
COROUTINE a portable C++ library for coroutine sequencing
point you in the right direction? It seems like an elegant solution that has lasted the test of time.....it's 9 years old!
In the DOC folder is a pdf of the paper A Portable C++ Library for Coroutine Sequencing by Keld Helsgaun which describes the library and provides short examples using it.
[update] I'm actually making successful use of it myself. Curiosity got the better of me, so I looked into this solution, and found it was a good fit for a problem I've been working on for some time!