What elegant method callback design should be used ?

Posted by ereOn on Stack Overflow See other posts from Stack Overflow or by ereOn
Published on 2010-05-04T15:28:14Z Indexed on 2010/05/04 15:38 UTC
Read the original article Hit count: 202

Filed under:
|
|
|
|

Hi,

I'm surprised this question wasn't asked before on SO (well, at least I couldn't find it).

Have you ever designed a method-callback pattern (something like a "pointer" to a class method) in C++ and, if so, how did you do it ?

I know a method is just a regular function with some hidden this parameter to serve as a context and I have a pretty simple design in mind. However, since things are often more complex than they seem to, I wonder how our C++ gurus would implement this, preferably in an elegant and standard way.

All suggestions are welcome !

© Stack Overflow or respective owner

Related posts about c++

Related posts about c++0x