std::alignment_of
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <type_traits> | ||
template<class T > struct alignment_of; | (dal C++11) | |
Fornisce il membro costante
value
uguale al valore allineamento del T
tipo, come se ottenuto da un'espressione alignof. Se T
è un tipo di matrice, restituisce i requisiti di allineamento del tipo di 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.
Indice |
Inherited from std::integral_constant
Member constants
value [statico] | alignof(typenamestd::remove_all_extents<T>::type) (pubblico membro statico costante) |
Member functions
operator std::size_t | converte l'oggetto in std::size_t, restituisce 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. (metodo pubblico) |
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> |
[modifica]Possibile implementazione
template<class T >struct alignment_of :std::integral_constant<std::size_t, alignof(typenamestd::remove_all_extents<T>::type)>{}; |
[modifica]Esempio
Output:
1 4 8
[modifica]Vedi anche
alignof operator | queries alignment requirements of a type (dal C++11) |
(C++11) | definisce il tipo idoneo all'uso come memoria non inizializzato per tipi di dimensione data 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. (classe template) |
(C++11) | definisce il tipo adatto per l'uso come memoria non inizializzata per tutti i tipi di dati 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. (classe template) |
(C++11) | Tipo di POD con il requisito di allineamento così grande come qualsiasi altro scalare 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) |