Jump to content
  • Advertisement
Sign in to follow this  
Thoran

[Solved] Registering an overloaded const get-method

This topic is 3160 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
I think you need to add const to the function signature.


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!