Re:Adding a Python style yield to C++
by scott_s on Monday April 26, 2010 @12:01PM
(#1295164)
As I noted below, you can solve the stack problem with setjmp() and longjmp(). But that's only portable across different Unixes, not across all systems which will have C++.
But, yes, I am in agreement: function objects are the better solution to this problem in C++. This sort of hackery, while neat, leads to a rats nest of problems.
But, yes, I am in agreement: function objects are the better solution to this problem in C++. This sort of hackery, while neat, leads to a rats nest of problems.