F
F
Flaker2013-11-25 13:57:23
C++ / C#
Flaker, 2013-11-25 13:57:23

(C++) Class method, like a callback function. How to best implement?

Class method like callback. How to implement in the most optimal way?
I’m asking about the optimal one, because I’ve already read a lot about this, but I still don’t understand what is better to use ...
Whoever dug into this in practice, give advice, please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rio, 2013-11-25
@Flaker

If the callback is for the system (for example, a handler for something called from the OS), then only as a static method with the necessary specifiers.
If for convenient use inside your code, then you can use a ready-made solution (FastDelegate, for example, is described: here ).
PS Yes, I completely forgot that the fresh C ++ standard now has std:: function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question