c++ Function member pointer

前端 未结 4 1931
伪装坚强ぢ
伪装坚强ぢ 2021-01-29 09:43

I have read several posts about this, but can\'t seem to find exactly what i am looking for with example code if anyone could give me some help i would highly appreciate it.

4条回答
  •  孤街浪徒
    2021-01-29 09:51

    You could do an overload such as:

    std::list eventList;
    void addEvent(void (*func)(Pack  *));
    template
    void addEvent(void (T::*func)(Pack  *));
    namespace Abstraction {
        template
        void abstractlyAddEvent( T, std::list *eventList );
    }
    

提交回复
热议问题