0

Of all the examples I've seen using mach_override, they override either C system functions or local functions, but never attempt to override a plain (not virtual) C++ member function of a class object.

The header code of mach_override includes macros for C++, but I'm starting to think that this is just for handling C++ name mangling of non class member functions. However, I'm hoping to be proved wrong.

In order to override a class member function, what would you need to pass as the class name to the mach_override C++ macro? I've tried class::*funcname, but that won't compile. Even if it did, I'm thinking that the override method would need a pointer to an instance object too.

So, is it possible to use mach_override to override a class member function and if so, how would you go about it?

Thanks.

4

0 回答 0