vc++中,用于显示调用 所重写的函数 对应的 基类的函数;有多个基类或多个基类的重写函数时,会调用最匹配的那个函数;
语法: __super::member_function();
只可以出现在成员函数的作用域内;
example:
// deriv_super.cpp
// compile with: /c
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)
}
};