名前空間
変種
操作

Storage duration specifiers

提供: cppreference.com
< cpp‎ | language

 
 
C + +言語
一般的なトピック
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
フロー制御
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
条件付き実行文
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
繰り返し文
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
文をジャンプします
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
関数の宣言
ラムダ関数の宣言
関数テンプレート
の歴史。インライン指定
例外仕様 (廃止予定)
noexcept指定子 (C++11)
例外
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
名前空間
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
指定子
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CV指定
貯蔵期間指定
constexprの指定子 (C++11)
自動指定 (C++11)
alignas指定子 (C++11)
初期化
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
リテラル
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
代替表現
ユーティリティ
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
型の別名宣言 (C++11)
属性 (C++11)
キャストします
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
暗黙の型変換
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
Cスタイルキャストと機能
メモリの割り当て
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
クラス
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
クラス固有の機能特性
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
明示 (C++11)
静的
特殊なメンバ関数
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
テンプレート
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
クラステンプレート
関数テンプレート
テンプレートの特殊化
パラメーターパック (C++11)
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
インラインアセンブリ
 
  • auto - 自動記憶期間。 (廃止予定)
    Original:
    auto - automatic storage duration. (廃止予定)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • register - 自動記憶期間。また、プロセッサのレジスタに変数を配置するために、コンパイラにヒント。 (廃止予定)
    Original:
    register - automatic storage duration. Also hints to the compiler to place the variable in the processor's register. (廃止予定)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • static - '静的記憶域期間と'内部リンケージ
    Original:
    static - static storage duration and internal linkage
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • extern - '静的記憶域期間と'外部リンケージ
    Original:
    extern - static storage duration and external linkage
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • thread_local - スレッド記憶域期間。 (C++11およびそれ以降)
    Original:
    thread_local - thread storage duration. (C++11およびそれ以降)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

目次

[編集] 説明

[編集] 記憶期間

プログラム内のすべての変数は、次の記憶域期間のいずれかを持っている
Original:
All variables in a program have one of the following storage durations:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • ' '自動記憶域期間。変数は、囲んでいるコードブロックの先頭に割り当てられ、端に割り当て解除されます。すべての非大域変数は宣言staticexternまたはthread_local..ものを除いて、この記憶域期間を持つ
    Original:
    automatic storage duration. The variable is allocated at the beginning of the enclosing code block and deallocated on end. All non-global variables have this storage duration, except those declared static, extern or thread_local.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' '静的記憶域期間。変数はプログラムの開始時に割り当てられたプログラムが終了すると、割り当てが解除されます。唯一の変数のインスタンスが1つ存在します。すべてのグローバル変数はこの記憶域期間を持つ、プラスのものはstaticまたはexternで宣言された.
    Original:
    static storage duration. The variable is allocated when the program begins and deallocated when the program ends. Only one instance of the variable exists. All global variables have this storage duration, plus those declared with static or extern.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' 'スレッド記憶域期間(C++11およびそれ以降)。変数は、スレッドの開始時に割り当てられ、スレッドが終了するときに解放されています。各スレッドは、変数の独自のインスタンスを持っています。唯一の変数はthread_localこの記憶域期間を持つと宣言した。 thread_localは、グローバル変数の宣言に加えて、それらはstaticまたはexternを使用して宣言することができます.
    Original:
    thread storage duration (C++11およびそれ以降). The variable is allocated when the thread begins and deallocated when the thread ends. Each thread has its own instance of the variable. Only variables declared thread_local have this storage duration. thread_local can only be declared for global variables, plus those declared with static or extern.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' 'ダイナミック記憶域期間。変数は動的メモリ割り当て機能を使用することによって割り当てられ、要求ごとに割り振り解除され.
    Original:
    dynamic storage duration. The variable is allocated and deallocated per request by using 動的メモリ割り当て functions.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[編集] リンケージ

リンケージは、別のスコープで参照される変数や関数の機能を指します。同じ識別子を持つ変数や関数が複数のスコープで宣言されているが、それらのすべてから参照できない場合は、変数の後、いくつかのインスタンスが生成されます。次の結合が認識されます
Original:
Linkage refers to the ability of a variable or function to be referred to in other scopes. If a variable or function with the same identifier is declared in several scopes, but cannot be referred to from all of them, then several instances of the variable are generated. The following linkages are recognized:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • ' 'ノーリンケージ。変数は、それがこのリンケージを持つインチ自動、スレッドとダイナミック記憶域期間を持つすべての変数にのみスコープから参照することができます.
    Original:
    no linkage. The variable can be referred to only from the scope it is in. All variables with automatic, thread and dynamic storage durations have this linkage.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' '内部リンケージ。変数は、現在の翻訳単位内のすべてのスコープから参照することができます。どちらstatic、またはconstを宣言しなくexternれる静的記憶域期間を持つすべての変数は、このリンケージを持つ.
    Original:
    internal linkage. The variable can be referred to from all scopes in the current translation unit. All variables with static storage duration which are either declared static, or const but not extern, have this linkage.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ' '外部リンケージ。変数は、他の翻訳単位内のスコープから参照することができます。静的記憶域期間を持つすべての変数は、それらの宣言static、またはconstを除いて、このリンケージを持たなくextern.
    Original:
    external linkage. The variable can be referred to from the scopes in the other translation units. All variables with static storage duration have this linkage, except those declared static, or const but not extern.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[編集] キーワード

auto, register, static, extern, thread_local

[編集]