This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Microsoft Specific C++ keyword "__super"


Is this supported in GCC, if so does it have a different name? Its very
handy.

The "__super" keyword allows you to call the parent(super) class without
needing to know what it is called, here is an example i've copied from the
MS docs.

struct B1
{
    void mf(int)
    {
    // ...
    }
};

struct B2
{
    void mf(short)
    {
    // ...
    }

    void mf(char)
    {
    // ...
    }
};

struct D : B1, B2
{
    void mf(short)
    {
        __super::mf(1); // Calls B1::mf(int)
        __super::mf('s'); // Calls B2::mf(char)
    }
};

int main()
{

}

Richard e Collins
www.maddoggames.com



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]