alignas 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 the alignment requirement of a type or an object.
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.
目次 |
[編集] 構文
alignas( expression )
|
(C + + 11以来) | ||||||||
alignas( type-id )
|
(C + + 11以来) | ||||||||
[編集] 説明
alignas指定子は、変数の宣言やクラスのデータメンバに適用することができる、またはそれはクラス/構造体/共用体または列挙型の定義に適用することができます.
Original:
The alignas specifier may be applied to the declaration of a variable or a class data member, or it can be applied to the definition of a class/struct/union or enum.
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.
フォームalignas(expression)で使用され、expressionが正の値に評価される整数定数式である場合、宣言された実体は、それが型の自然境界整列要件を弱めたい場合を除いて、expressionのまさに結果に設定され、その整列要求を持つことになります。
Original:
When used in form alignas(expression), and expression is an integral constant expression that evaluates to a positive value, the declared entity will have its alignment requirement set to exactly the result of the expression, except if it would weaken the natural alignment requirement of the type.
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.
フォームalignas(type)で使用する場合は、宣言された実体の整列要件がalignas(alignof(type))のアラインメント要件等しくなり、あるtype、とまったく同じです
Original:
When used in form alignas(type), is exactly equivalent to alignas(alignof(type)), that is, the alignment requirement of the declared entity will be equal the alignment requirement of type
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.
[編集] ノート
alignas(0)効果がありません.
Original:
alignas(0) has no effect.
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.
複数alignas指定子は同じ変数またはクラスに適用されると、厳しいものが使用され.
Original:
When multiple alignas specifiers are applied to the same variable or class, the strictest one is used.
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.
C言語は、ヘッダーalignasでプリプロセッサマクロとして<stdalign.h>を定義していますが、C + +でこれがキーワードであり、ヘッダが<stdalign.h>と<cstdalign>ようなマクロを定義しないでください。彼らは、しかし、マクロ定数__alignas_is_definedを定義しない.
Original:
The C language defines alignas as a preprocessor macro in the header <stdalign.h>, but in C++ this is a keyword, and the headers <stdalign.h> and <cstdalign> do not define such macro. They do, however, define the macro constant __alignas_is_defined.
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.
[編集] キーワード
[編集] 例
// every object of type sse_t will be aligned to 16-byte boundary struct alignas(16) sse_t { float sse_data[4]; }; // the array "cacheline" will be aligned to 128-byte boundary char alignas(128) cacheline[128];
[編集] も参照してください
| alignof operator | queries alignment requirements of a type (C + + 11以来) |
| (C++11) |
型の整列要求を取得します Original: obtains the type's alignment requirements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |