• Advertisement
Sign in to follow this  

How can I register operator function of class ?

This topic is 3696 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

class A { operator int( ) { // do something ... } }; How to register this in angelscript ? thansk !!!

Share this post


Link to post
Share on other sites
Advertisement
Documentation

For your particular example you would register it as:


r = engine->RegisterObjectBehaviour("type", asBEHAVE_VALUE_CAST, "int f()", asMETHOD(A, operator int), asCALL_THISCALL); assert( r >= 0 );

Share this post


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

  • Advertisement