Advertisement

Can cast object method to uint

Started by June 20, 2015 11:08 AM
1 comment, last by WitchLord 9 years, 5 months ago

It is possible to cast an object method to a uint like this:


void test()
{
    string s;
    uint i = uint( s.length );
    
    string s2 = i;
    
    Print( s2 );
}

The result here is 0.

Print is a function that takes a const string& in, it prints to std::cout.

In our game, this caused a crash. A method taking ?& in directly took a variable of the form uint( s.length ).

Thanks. That should definitely not be possible.

I'll investigate and have it fixed a.s.a.p.

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

Advertisement

I've fixed this in revision 2181.

Regards,

Andreas

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