final specifier
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
仮想関数は、派生クラス内またはクラスは継承できませんそのオーバーライドできないことを指定します
Original:
Specifies that a 仮想関数 can not be overridden in a derived class or that a class cannot be inherited
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 final ;
|
|||||||||
class class_name final base_classes
|
|||||||||
This section is incomplete Reason: function_declaration is probably wrong terminology |
[編集] 説明
仮想関数の宣言で使用する場合は、
final
は、関数が派生クラスによってオーバーライドされないかもしれないことを指定します.Original:
When used in a virtual function declaration,
final
specifies that the function may not be overridden by derived classes.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.
finalメンバ関数宣言またはクラスの頭の中で使用される特殊な意味を持つ識別子です。他の文脈では予約されていないと名前のオブジェクトおよび関数に使用されるかもしれません.
Original:
final is an identifier with a special meaning when used in a member function declaration or class head. In other contexts it is not reserved and may be used to name objects and functions.
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() final; }; struct B final : A { void foo(); // Error: foo cannot be overridden as it's final in A }; struct C : B // Error: B is final { };
[編集] 参照
- 指定子をオーバーライドします (C++11およびそれ以降)