class methods

Top  Previous  Next

What is translated > Types > Records, Classes, Interfaces > Class > class methods

Delphi class methods are similar to C++ static methods, but there are two differences:

 

 

1.Delphi class methods can be virtual, C++ static methods cannot.Therefore Delphi2Cpp II has to use a tricky construction to reproduce this ability of Delphi.
2.In the defining declaration of a class method, the identifier Self represents the class where the method is called. In C++ however inside of a static function there is no counterpart to Delphi's Self (this isn't defined her).

 

 

Therefore the two cases have to be distinguished at the translation of Delphi class methods to C++ and Delphi's Self-instance requires additional treatment:

 

non virtual class methods

virtual class methods

Self instance

 

 

 



This page belongs to the DelphiXE2Cpp11 Documentation

DelphiXE2Cpp11 home  Content