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)
}
};