Microsoft Specific C++ keyword "__super"

Richard E Collins richard@collins1969.fsnet.co.uk
Wed Aug 25 13:45:00 GMT 2004


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




More information about the Gcc mailing list