Sign in to follow this  

When to use global wrapper functions for class members?

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

I had a look at the scriptmath3d add-on and I am struggling with understanding when to use a global wrapper function and when to use the native class member for registering in angelscript. What I understood so far is that when using the generic calling convention I always need a wrapper, due to unpacking variables from the script objects stack. But looking at the native calling convention implementation of the Vector3 I see also global wrapper functions for the three constructors, while the operator members (like +, - etc.) are registered directly as I would expect it. Can someone please explain me the reason for the global wrapper functions for the constructors? Thanks in advance. Thoran

Share this post


Link to post
Share on other sites
C++ doesn't allow you to take the address of a constructor or a destructor, so these kinds of members always need wrappers.

Share this post


Link to post
Share on other sites

This topic is 2816 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this