Namespace
Varianti

alignas specifier

Da cppreference.com.
< cpp‎ | language

 
 
Linguaggio C + +
Temi generali
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Controllo del flusso
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dichiarazioni esecuzione condizionale
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Iterazione dichiarazioni
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Vai dichiarazioni
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funzioni
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
dichiarazione di funzione
lambda funzione dichiarazione
funzione di modello
specificatore inline
eccezioni specifiche (deprecato)
noexcept specificatore (C++11)
Eccezioni
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Spazi dei nomi
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipi
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
Specifiers
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv specificatori
Durata di stoccaggio specificatori
constexpr specificatore (C++11)
specificatore auto (C++11)
alignas specificatore (C++11)
Inizializzazione
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Letterali
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Espressioni
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rappresentazioni alternative
Utilities
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipi
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
Tipo alias dichiarazione (C++11)
attributi (C++11)
Lancia
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversioni implicite
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
Fusione C-stile e funzionale
Occupazione della memoria
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classi
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Specifiche per una classe di funzioni proprietà
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
esplicito (C++11)
statico
Funzioni membro speciali
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modelli
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
classe template
funzione di modello
modello di specializzazione
parametri confezioni (C++11)
Varie
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Montaggio in linea
 
Specifica i requisiti di allineamento di un tipo o di un oggetto.
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.

Indice

[modifica] Sintassi

alignas( expression ) (dal C++11)
alignas( type-id ) (dal C++11)

[modifica] Spiegazione

Lo specificatore alignas può essere applicato alla dichiarazione di una variabile o di un membro di dati di classe, oppure può essere applicato alla definizione di una classe / struct / union o enum.
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.
Quando utilizzato in forma alignas(expression), e expression è un'espressione costante integrale che restituisce un valore positivo, l'entità dichiarato avrà il suo set requisito allineamento esattamente il risultato della expression, salvo che indebolirebbe la condizione naturale allineamento del tipo.
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.
Quando utilizzato in forma alignas(type), è esattamente equivalente a alignas(alignof(type)), cioè, la condizione di allineamento dell'entità dichiarati sarà uguale al requisito di allineamento 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.

[modifica] Note

alignas(0) non ha alcun effetto.
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.
Quando più specificatori alignas sono applicati alla stessa variabile o di classe, la massima si è utilizzato.
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.
Il linguaggio C definisce alignas come macro di preprocessore in <stdalign.h> intestazione, ma in C + + si tratta di una parola chiave, e le intestazioni <stdalign.h> e <cstdalign> non definiscono tale macro. Essi, tuttavia, definire la macro __alignas_is_defined costante.
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.

[modifica] Parole chiave

alignas

[modifica] Esempio

// 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];



[modifica] Vedi anche

alignof operator queries alignment requirements of a type (dal C++11) [edit]
ottiene requisiti di allineamento del tipo
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.

(classe template) [edit]