🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Implicit object construction in return statement

Started by
0 comments, last by WitchLord 8 years, 8 months ago

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.

Advertisement

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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement