This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Blocks in g++ ?


>>>>> "Joern" == Joern Rennecke <amylaar@cygnus.co.uk> writes:

    >> yes, that's what i thought. afaik you can't pass nested
    >> functions as parameters to unrelated calls (in a foreign
    >> context), where you can pass closures.

oops. i ment you CAN pass, of course. so...

    Joern> You can.  What you can't do is store a pointer to a nested
    Joern> function and use it after the function it was nested in has
    Joern> returned.

indeed, i hadn't thought about that (neither about that use nor it's
infeasibility). it would be nice for GUI programming of course, so you 
could write all those eventhandlers/callbacks very easily. 

still, even if the closure is only available during the nested
function call, it would be useful for a lot of things... 

	    "Thomas Steffen" <for_replies_only@iname.com>
-- 
linux, linuctis - f, das beste Betriebssystem ;-) [Tobi in doc]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]