• Saves Valuable Time
  • Trusted Accuracy since 2004
  • 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
    int IntValue = 0;

    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 © 2004 – 2021 Tangible Software Solutions, Inc.