What is the simplest way to create and call dynamically a class method in C++?

后端 未结 8 1167
太阳男子
太阳男子 2021-01-01 05:28

I want to fill a map with class name and method, a unique identifier and a pointer to the method.

typedef std::map

        
8条回答
  •  猫巷女王i
    2021-01-01 06:33

    Like many C++ questions, this looks like another application of Boost. You basically want to store the result of boost::bind(&Class::member, &Object). [edit] Storing such a result is easy with boost::function.

提交回复
热议问题