Jump to content
  • Advertisement
Sign in to follow this  
gjl

Implicit object construction in return statement

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

Hi,

 

Is there a particular reason why angelscript does not support implicit constructor calls with return statements? For example the following code will typically work fine with C++ but requires an explicit constructor call with angelscript:

    class Dummy
    {
        Dummy(int i){};
    };
    Dummy testConstruct()
    {
        return 2; // error, requires Dummy(2)
    }; 

Ideally, it would be nice if the following code could work too, if you think it makes sense:

    class Dummy
    {
        Dummy(int i){};
    };

    Dummy@ testConstruct()
    {
        return 2;
    };

Note: I am still using v2.29.2 because of the JIT (I haven't had much time to try to fix it yet for v2.30),but I believe this is still the case with the new version - I apologize if it is not the case.

Edited by gjl

Share this post


Link to post
Share on other sites
Advertisement

Implicit conversions still doesn't work in all situations. I'll look into adding support for this in an upcoming release.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!