Name: Anonymous 2011-03-29 20:53
so how does one store a pointer to a member function and the object from which to call that function, and then call said function from said object?
example:
struct test {
/*generic function object*/ fun_ptr;
some_object* object_instance;
} this_test;
some_object new_obj;
this_test.fun_ptr = &some_object::some_function;
this_test.object_instance = &new_obj;
this_test.object_instance->this_test.fun_ptr(/*arguments*/);
???
example:
struct test {
/*generic function object*/ fun_ptr;
some_object* object_instance;
} this_test;
some_object new_obj;
this_test.fun_ptr = &some_object::some_function;
this_test.object_instance = &new_obj;
this_test.object_instance->this_test.fun_ptr(/*arguments*/);
???