At
http://msdn.microsoft.com/visualc/de...BakerDozen.asp
this code sample is provided:
// V2 Syntax
public ref class Vector sealed {
public:
Vector( double x, double y, double z );
static bool operator ==( const Vector^, const Vector^ );
static Vector^ operator /( const Vector^, double );
static Vector^ operator +( const Vector^, const Vector^ );
static Vector^ operator -( const Vector^, const Vector^ );
};
int main()
{
Vector^ pa = gcnew Vector( 0.231, 2.4745, 0.023 ),
Vector^ pb = gcnew Vector( 1.475,4.8916,-1.23 );
Vector^ pc1 = pa + pb;
Vector^ pc2 = pa - pc1;
Vector^ pc3 = pc1 / pc2->x();
if ( pc1 == p2 ) // ...
}
Are these operators considered as equivalent to the non-member ones, or
the non-member ones will be considered a separate case, and will not
work with the rest .NET languages?
--
Ioannis Vranos