Borland / Delphi alternative for __super keyword

The __super keyword is specific to Microsoft. It is used to access the virtual methods of the parent class. Do you know alternative keywords for borland C ++ / delphi compilers?

class MyBaseClass { virtual void DoSomething(); }; class MyDerivedClass : public MyBaseClass { virtual void DoSomething(); }; void MyBaseClass::DoSomething() { // some code } void MyDerivedClass::DoSomething() { __super::DoSomething(); // calls implementation of base class - no need to know name of base class // implementation specific to derived class adding new functionality } 
+6
source share
3 answers

Equivalent to Delphi inherited . As far as I know, there is no equivalent in C ++ Builder, and of course, __super is a non-standard MS extension.

+9
source
  • Delphi: inherited MyMethod(MyParam); or abbreviated inherited;
  • C ++ Builder: MyBaseClass::MyMethod(MyParam);
+7
source

In Delphi, the equivalent is inherited . You can see examples of its use in RTL and VCL sources.

+3
source

Source: https://habr.com/ru/post/902747/


All Articles