std::alignment_of
Aus 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. |
definiert in Header <type_traits>
|
||
template< class T > struct alignment_of; |
(seit C++11) | |
Bietet das Mitglied konstanten
value
gleich der Angleichung Voraussetzung des Typs T
, als ob durch einen alignof Ausdruck erhalten. Wenn T
ein Array-Typ ist, gibt die Ausrichtung Anforderungen der Element-Typ .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.
Inhaltsverzeichnis |
Inherited from std::integral_constant
Member constants
value [statisch] |
alignof(typename std::remove_all_extents<T>::type) (public static Mitglied konstanten) |
Member functions
operator std::size_t |
wandelt das Objekt std::size_t, gibt 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. (öffentliche Elementfunktion) |
Member types
Type
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> |
[Bearbeiten] Mögliche Implementierung
template< class T > struct alignment_of : std::integral_constant< std::size_t, alignof(typename std::remove_all_extents<T>::type) > {}; |
[Bearbeiten] Beispiel
Output:
1 4 8
[Bearbeiten] Siehe auch
alignof operator | queries alignment requirements of a type (seit C++11) |
(C++11) |
definiert den Typ für die Verwendung als Speicher für initialisierten Arten von vorgegebener Größe 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. (Klassen-Template) |
(C++11) |
definiert die Art geeignet zur Verwendung als Speicher für alle initialisierten gegebenen Typen 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. (Klassen-Template) |
(C++11) |
POD-Typ mit Angleichung Voraussetzung so groß wie alle anderen skalaren Typ 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) |