override specifier
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
仮想関数が別の仮想関数をオーバーライドすることを指定し.
Original:
Specifies that a 仮想関数 overrides another virtual function.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] 構文
function_declaration override ;
|
|||||||||
This section is incomplete Reason: function_declaration is probably wrong terminology |
[編集] 説明
メソッドの宣言では、
override
は、関数が基底クラスのメソッドをオーバーライドする必要があることを指定し.Original:
In a method declaration,
override
specifies that the function must be overriding a base class method.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
override関数宣言の後に使用し、特別な意味を持つ識別子は、それ以外の場合は予約されていない.
Original:
override is an identifier with a special meaning when used after function declaration, otherwise it's not reserved.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
struct A { virtual void foo(); void bar(); }; struct B : A { void foo() const override; // Error: Has a different signature from A::foo void foo() override; // OK: base class contains a virtual function with the same signature void bar() override; // Error: B::bar doesn't override because A::bar is not virtual };
[編集] 参照
- 最後の子 (C++11およびそれ以降)