Talk:Is closure

From RAD Studio
Jump to: navigation, search

Hello,

I find this sentence confusing:


> "Using a closure, you can get a pointer to a member function for any object, regardless of its inheritance hierarchy."


A member function pointer and a closure are different because the closure also stores an instance pointer, not just the member function pointer. And a closure is more flexible because it's not tied to a specific class type the way a member function pointer is.

This link does a very good job illustrating the difference between a closure and a member function pointer: http://docwiki.embarcadero.com/RADStudio/en/C%2B%2B_Keyword_Extensions#_closure

Cheers,

Bruneau