std::alignment_of
Da 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. |
Definido no cabeçalho <type_traits>
|
||
template< class T > struct alignment_of; |
(desde C++11) | |
Fornece o membro constante
value
igual ao requisito de alinhamento do T
tipo, tal como se obtém por uma expressão alignof. Se T
é um tipo de matriz, retorna os requisitos de alinhamento do tipo de elemento.Original:
Provides the member constant
value
equal to the alignment requirement of the type T
, as if obtained by an alignof expression. If T
is an array type, returns the alignment requirements of the element 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.
Índice |
Herdado de std::integral_constant
Member constants
value [estática] |
alignof(typename std::remove_all_extents<T>::type) (membro estático público constante) |
Member functions
operator std::size_t |
converte o objeto em std::size_t, retorna value Original: converts the object to std::size_t, returns value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) |
Member types
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
value_type
|
std::size_t
|
type
|
std::integral_constant<std::size_t, value> |
[editar] Possível implementação
template< class T > struct alignment_of : std::integral_constant< std::size_t, alignof(typename std::remove_all_extents<T>::type) > {}; |
[editar] Exemplo
Saída:
1 4 8
[editar] Veja também
alignof operator | queries alignment requirements of a type (desde C++11) |
(C++11) |
define o tipo adequado para utilização como armazenamento não inicializada para tipos de determinado tamanho Original: defines the type suitable for use as uninitialized storage for types of given size The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
define o tipo adequado para utilização como armazenamento não inicializados para todos os tipos de dados Original: defines the type suitable for use as uninitialized storage for all given types The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
(C++11) |
Tipo POD com exigência de alinhamento tão grande quanto qualquer outro tipo escalar Original: POD type with alignment requirement as great as any other scalar type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) |