• Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

We're also offering banner ads on our site from just \$5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.

### #ActualFDsagizi

Posted 27 September 2013 - 09:19 PM

r = en->RegisterObjectBehaviour("Vec3", asBEHAVE_IMPLICIT_VALUE_CAST, "string f()", asMETHOD(Vec3,ToString), asCALL_THISCALL ); nu_assert( r >= 0 );

this code work fine:

Vec3 my_vec;
string str = my_vec; ( Vec3 can convert to string )
But, this code wrong:

Vec3 vec;
string s1;
string s2 = s1 + vec3; // for this case be best if AS automaticly find variant when he can append to string

### #3FDsagizi

Posted 27 September 2013 - 09:18 PM

r = en->RegisterObjectBehaviour("Vec3", asBEHAVE_IMPLICIT_VALUE_CAST, "string f()", asMETHOD(Vec3,ToString), asCALL_THISCALL ); nu_assert( r >= 0 );

this code work fine:

Vec3 my_vec;
string str = my_vec; ( Vec3 can convert to string )
But, this code wrong:

Vec3 vec;
string s1;
string s2 = s1 + vec3; // for this case be best if AS automaticly find variant when he can append to string

### #2FDsagizi

Posted 27 September 2013 - 09:18 PM

r = en->RegisterObjectBehaviour("Vec3", asBEHAVE_IMPLICIT_VALUE_CAST, "string f()", asMETHOD(Vec3,ToString), asCALL_THISCALL ); nu_assert( r >= 0 );

this code work fine:

Vec3 my_vec;
string str = my_vec; ( Vec3 can convert to string )

But, this code wrong:

Vec3 vec;
string s1;
string s2 = s1 + vec3; // for this case be best if AS automaticly find variant when he can append to string

### #1FDsagizi

Posted 27 September 2013 - 09:18 PM

r = en->RegisterObjectBehaviour("Vec3", asBEHAVE_IMPLICIT_VALUE_CAST, "string f()", asMETHOD(Vec3,ToString), asCALL_THISCALL ); nu_assert( r >= 0 );

this code work fine:

Vec3 my_vec;
string str = my_vec; ( Vec3 can convert to string )

But, this code wrong:

Vec3 vec;
string s1;
string s2 = s1 + vec3; // for this case be best if AS automaticly find variant when he can append to string

PARTNERS