What is the practical use of pointers to member functions?

后端 未结 12 1531
醉酒成梦
醉酒成梦 2020-12-03 08:13

I\'ve read through this article, and what I take from it is that when you want to call a pointer to a member function, you need an instance (either a pointer to one or a sta

12条回答
  •  青春惊慌失措
    2020-12-03 08:54

    The best use of pointers to member functions is to break dependencies.

    Good example where pointer to member function is needed is Subscriber/Publisher pattern :

    http://en.wikipedia.org/wiki/Publish/subscribe

提交回复
热议问题