const overloading, registering with asMETHOD

Started by
1 comment, last by blubberbernd 12 years, 7 months ago
Hi,

I currently have this problem. I have a class with two identical member functions, one const, the other not const:


class MyClass
{
public:
obj* getObj() {return o;}
const obj* getObj() const {return o;}
}


If I now want to register MyClass::getObj() to AS with engine->RegisterObjectMethod(), I can't to this because I get the error "Invalid overload of asMETHOD(...)".

Obviously this is because I have two functions with the same name and parameters. How do I solve this problem?
Advertisement
You would want to use asMETHODPR() rather than asMETHOD(). Examples of use are on the Registering a function documentation page.
Ah, Ok.

Thank you very much. :)

This topic is closed to new replies.

Advertisement