Content deleted Content added
added c++ generators topic |
|||
Line 354:
[[User:CheyenneWills|CheyenneWills]] 20:49, 25 June 2007 (UTC)
==C++ generators==
I don't think C++ properly supports generators. There is no way to have the compiler save
the stack frame; as in the example, the object must remember its own state. Overloading
the function call operator makes it look somewhat like a (hypothetical) C++ generator,
but a constructor call is still needed. It's close, but this can done, with vary degrees
of syntactical success, in most object-oriented languages.
|