i find this strange bug, problem show as we use "string" and "if"
this code compilate, and work normal
void SetTexture( string txt ){}
void startGame( string &type )
{
//if(false) SetTexture( "");
string set_text = "hello world";
output( "1 " );
output( "2 " + set_text );
output( "3 " );
}
output:
1
2 hello world
3
this code work not correct in release, and in debug asserted
void SetTexture( string txt ){}
void startGame( string &type )
{
if(false) SetTexture( "");
string set_text = "hello world";
output( "1 " );
output( "2 " + set_text );
output( "3 " );
}
in release result:
1
3
i use my string class, register as:
r=en->RegisterObjectType("string", sizeof(Str), asOBJ_VALUE | asOBJ_APP_CLASS_CDAK); assert( r >= 0 );
r=en->RegisterObjectBehaviour("string", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructStr), asCALL_CDECL_OBJLAST); assert( r >= 0 );
r=en->RegisterObjectBehaviour("string", asBEHAVE_CONSTRUCT, "void f(const string &)", asFUNCTION(CopyConstructStr), asCALL_CDECL_OBJLAST); assert( r >= 0 );
r=en->RegisterObjectBehaviour("string", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(DestructStr), asCALL_CDECL_OBJLAST); assert( r >= 0 );
r=en->RegisterStringFactory("string", asFUNCTION( StrFactory ), asCALL_CDECL); assert( r >= 0 );