VC ++ - __super

VC ++、書き換え表示するための基本クラスの関数呼び出しに対応する機能、塩基以上のベースクラスオーバーライド機能を複数、その機能は、ベストマッチと呼ばれるであろう。

構文:__super :: member_function(); 

それが唯一のメンバ関数のスコープに表示されます。

例:

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

 

公開された69元の記事 ウォン称賛10 ビュー30000 +

おすすめ

転載: blog.csdn.net/u010096608/article/details/103461144