Keyword __super is Microsoft specific. It is used to access virtual methods of 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
}
The equivalent in Delphi is inherited
. So far as I know, there is no equivalent in C++ Builder and of course __super
is a non-standard MS extension.
inherited MyMethod(MyParam);
or shortened inherited;
MyBaseClass::MyMethod(MyParam);
In Delphi, the equivalent is inherited. You can see examples of it in use in the RTL and VCL sources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With