|
|
|
|
|
by ryao
302 days ago
|
|
Member function pointers and member functions in C++ are two different things. Member function pointers are not OOP. They are data abstraction. The entire point of OOP is to make contracts with the compiler that forcibly tie certain things together that are not tied together with data abstraction. Member functions are subject to inheritance and polymorphism. Member function pointers are not. Changing the type of your class will never magically change the contents of a member function pointer, but it will change the constants of a non-virtual member function. A member function will have a this pointer to refer to the class. A member function pointer does not unless you explicitly add one (named something other than this in C++). |
|
You claim when the compiler does this, it's OOP, but when I do it, it's not?