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.
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).

 

 

From C++Builder 2009 on there is the additional keyword __classmethod to - partially - reproduce Delphi class method, For other compilers class methods are converted to static methods.

 

 

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content