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 VB to C++ Converter, the first parameter is removed and corresponds to 'this'.
|Public Class SomeType
Private IntValue As Integer
Public Shared Operator +(ByVal X As SomeType, ByVal Y As SomeType) As Integer
Return X.IntValue + Y.IntValue
int IntValue = 0;
int operator + (const SomeType &Y)
return this->IntValue + Y.IntValue;
Use VB to C++ Converter to convert from VB to C++.
VB.NET and C++ Equivalents
Copyright © 1997 – 2019 Tangible Software Solutions, Inc.