Advertisement

[Solved] Registering an overloaded const get-method

Started by April 16, 2010 03:53 AM
1 comment, last by Thoran 14 years, 7 months ago
A quick question on how to register a class method that is a get-method for a member which is overloaded and const, using the asMETHODPR macro. My method signatures:

//Both methods are exported to AS
float x() const;  //set Method for member
void x(float v);  //set method for member





My registering call so far:

engine.registerClassMethod("Vector4","float x(void)", asMETHODPR(Vector4,x,(void),float));





The registering call throws an compile error, I think because of the difference in the method signature between the registering call and the actual method signature in the class. Hope anyone can help. Thanks, Thoran [Edited by - Thoran on April 16, 2010 9:04:17 AM]
My website
I think you need to add const to the function signature.

engine.registerClassMethod("Vector4","float x(void) const", asMETHODPR(Vector4,x,(void) const,float));
Advertisement
Thanks, worked perfectly. Issue solved.

Thoran
My website

This topic is closed to new replies.

Advertisement