access specifiers
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
classまたはstruct本体で以下のような宣言子の可視性を定義します
Original:
In a class or struct body define the visibility of following declarators
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.
継承リストに、継承されたメンバーの最大の可視性を定義します
Original:
In a inheritance list, define the maximum visibility of inherited members
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.
[編集] 構文
public: declarators | (1) | ||||||||
protected: declarators | (2) | ||||||||
private: declarators | (3) | ||||||||
class identifier : public class_name
|
(4) | ||||||||
class identifier : protected class_name
|
(5) | ||||||||
class identifier : private class_name
|
(6) | ||||||||
[編集] 説明
指定子は、パブリックなアクセシビリティを持って後に#シンボルが宣言された
Original:
# The symbols declared after the specifier have public accessibility
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.
指定子には、アクセシビリティを保護した後に#シンボルが宣言された
Original:
# The symbols declared after the specifier have protected accessibility
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.
指定子がプライベートアクセシビリティを持った後、#シンボルが宣言された
Original:
# The symbols declared after the specifier have private accessibility
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.
#継承されたメンバは、基本クラスと同じアクセシビリティを(どちらかprotectedまたはpublic、privateとして、派生クラスでは表示されません)を持っています
Original:
# The inherited members have the same accessibility as the base class ( either protected or public as private won't be visible in the derived class )
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.
#継承されたメンバーは、派生クラスでアクセシビリティを保護している
Original:
# The inherited members have protected accessibility in the derived class
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.
#継承されたメンバーは、派生クラスでプライベートアクセシビリティを持つ
Original:
# The inherited members have private accessibility in the derived class
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.
[編集] 指定子によってメンバのアクセシビリティ
;公共
Original:
;public
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.
- パブリックメンバは、クラスのスコープ内と外、どこでもアクセス可能ですOriginal:public members are accessible everywhere, within and outside the class scopeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
、保護されています
Original:
;protected
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.
- 保護されたメンバーは、クラスとそのメソッド内とその子孫でアクセス可能ですOriginal:protected members are accessible within the class and its methods and in its descendantsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
;プライベート
Original:
;private
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.
- プライベートメンバは、クラスとそのメソッド内でアクセスすることができますOriginal:private members can be only accessed within the class and its methodsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
protectedまたはprivateメンバに外部の関数やクラスへのアクセスを許可するには、友情宣言はクラス本体内に存在する必要があります
Original:
To grant access to external functions or classes to protected or private members, a 友情宣言 must be present in the class body
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.
継承されたプライベートメンバはクラスデータ内に存在するが、直接アクセスすることはできません
Original:
Inherited private members are still present in the class data but cannot be accessed directly
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.
class継承とメンバーのデフォルトプライベートアクセシビリティを有し、struct代わりにデフォルトパブリックアクセシビリティを持っています
Original:
A class has default private accessibility for inheritance and members, a struct has instead a default public accessibility
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.
This section is incomplete Reason: example |