std::max_align_t
来自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. |
| Defined in header <cstddef>
|
||
| typedef /*implementation-defined*/ max_align_t; |
(C++11 起) | |
std::max_align_t是一個POD類型的對齊要求至少是嚴格的(大),每標量類型.
Original:
std::max_align_t is a POD type whose alignment requirement is at least as strict (as large) as that of every scalar 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.
[编辑] 注釋
返回的指針分配的功能,如std::malloc適當的任何對象對齊,這意味著他們至少對齊嚴格std::max_align_t.
Original:
Pointers returned by allocation functions such as std::malloc are suitably aligned for any object, which means they are aligned at least as strict as std::max_align_t.
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.
std::max_align_t通常是最大的標量類型,這是long double在大多數平台上,並對齊要求是8或16的代名詞.....
Original:
std::max_align_t is usually synonymous with the largest scalar type, which is long double on most platforms, and its alignment requirement is either 8 or 16.
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.
[编辑] 為例
#include <iostream> #include <cstddef> int main() { std::cout << alignof(std::max_align_t) << '\n'; }
Output:
16
[编辑] 另請參閱
| 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. (類模板) |
| (C++11) |
如果一個類型的檢查是標量類型 Original: checks if a type is scalar type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (類模板) |