• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

VB Equivalent to C++ Operator Overloading

VB operator overloading is similar to C++ operator overloading, except that VB operator overloads are static methods while C++ operator overloads are instance methods. During conversion by C++ to VB Converter, references to 'this' within the method are converted to the added first parameter.

C++ VB
class SomeType
{
private:
    int IntValue = 0;

public:
    int operator + (const SomeType &Y)
    {
        return this->IntValue + Y.IntValue;
    }
};
Public Class SomeType
    Private IntValue As Integer = 0

    Public Shared Operator + (ByVal ImpliedObject As SomeType, ByVal Y As SomeType) As Integer
        Return ImpliedObject.IntValue + Y.IntValue
    End Operator
End Class


Use C++ to VB Converter to convert from C++ to VB.     

Additional resource: VB.NET and C++ Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.