Advertisement

const overloading, registering with asMETHOD

Started by August 25, 2011 04:03 PM
1 comment, last by blubberbernd 13 years, 3 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?
You would want to use asMETHODPR() rather than asMETHOD(). Examples of use are on the Registering a function documentation page.
Advertisement
Ah, Ok.

Thank you very much. :)

This topic is closed to new replies.

Advertisement