final specifier
提供: cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
仮想関数は、派生クラス内またはクラスは継承できませんそのオーバーライドできないことを指定します
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以来)

