🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
base class method registration
I have
class _A {
public:
inline void Method();
};
class _B : public _A {};
When I try to register
asEngine->RegisterObjectMethod("_B","void Method()",asMETHOD(_B, Method), asCALL_THISCALL);
it says it doesn't like that. I also tried it asMETHOD(_A,Method), which it liked even less.
I seem to recall there was a restriction on virtual methods, but I was not aware it extended to ALL base class methods. Is my understanding correct or have I missed something?
Thanks!
This is in fact a limitation of C++. It can't resolve _B::Method, because it wasn't inherited. _A::Method, ought to work. I don't know why that isn't so. Try making the method virtual.
Virtual methods are supported, as well as virtual methods from classes with multiple inheritance. The only thing that is not supported is virtual inheritance, i.e:
class _B : virtual _A {};
Virtual methods are supported, as well as virtual methods from classes with multiple inheritance. The only thing that is not supported is virtual inheritance, i.e:
class _B : virtual _A {};
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement