Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're 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

i thinking about this when i use Vec3 and convert to string class.
 
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

i thinking about this when i use Vec3 and convert to string class.
 
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

i thinking about this when i use Vec3 and convert to string class.
 
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

i thinking about this when i use Vec3 and convert to string class.
 
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