March 02, 2007
Lionello Lunesu Wrote:
> I've had much need for passing function-pointers as delegates, but never the other way around.

For example use object's methods as win32 window procedures, or as callbacks in C-libraries.

-- 
serg.
March 03, 2007
Just for my understanding:
If functionpointers could hold delegates would delegates become completly redundant?


> Lionello Lunesu wrote:
> > But how can a delegate ever get "thunked" to behave like a function? R delegate(X...) => R function(C,X...), with the C the context ?
> 
> Basically, a bit of code is generated at run-time (on the heap) that
> calls the delegate with the correct context pointer. Then that code is
> pointed to by the function pointer.
> The context pointer can be put into the code as an immediate value.

March 03, 2007
Philipp Spöth wrote:
> Just for my understanding:
> If functionpointers could hold delegates would delegates become completly redundant?

They'd probably still be the most efficient method.
1 2
Next ›   Last »