How do I implement a callback in C++?

前端 未结 6 2230
野性不改
野性不改 2020-12-05 19:52

I want to implement a class in c++ that has a callback.

So I think I need a method that has 2 arguments:

  • the target object. (let\'s say *myObj)
  • <
6条回答
  •  甜味超标
    2020-12-05 20:09

    Also, look at the Observer Pattern and signals and slots . This extends to multiple subscribers.

提交回复
热议问题