C# operator overloading is similar to C++ operator overloading, except that C# operator overloads are static methods while C++ operator overloads are instance methods. During conversion by C++ to C# Converter, references to 'this' within the method are converted to the added first parameter.
int IntValue = 0;
int operator + (const SomeType &Y)
return this->IntValue + Y.IntValue;
|public class SomeType
private int IntValue;
public static int operator + (SomeType ImpliedObject, SomeType Y)
return ImpliedObject.IntValue + Y.IntValue;
Use C++ to C# Converter to convert from C++ to C#.
C++ and C# Equivalents
Copyright © 1997 – 2017 Tangible Software Solutions Inc.