◐ Shell
clean mode source ↗

std::align - cppreference.com

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.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

Elemento definito nell'header

<memory>

void* align( std::size_t alignment, std::size_t size, void*& ptr, std::size_t& space );

(dal C++11)

Se è possibile montare bytes size di stoccaggio allineato alignment nel buffer puntato da ptr con space lunghezza, la funzione modifica ptr per puntare al primo indirizzo possibile di tale stoccaggio allineate e diminuisce space dal numero di byte utilizzato per l'allineamento. Se è impossibile (il buffer è troppo piccolo), non fa nulla.. align

Original:

If it is possible to fit size bytes of storage aligned by alignment into the buffer pointed to by ptr with length space, the function modifies ptr to point to the first possible address of such aligned storage and decreases space by the number of bytes used for alignment. If it is impossible (the buffer is too small), align does nothing.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parametri

alignment -

l'allineamento desiderato

Original:

the desired alignment

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

size -

la dimensione della memoria da allineare

Original:

the size of the storage to be aligned

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

ptr -

puntatore alla memorizzazione contiguo di almeno byte space

Original:

pointer to contiguous storage of at least space bytes

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

space -

la dimensione del buffer in cui operare

Original:

the size of the buffer in which to operate

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valore di ritorno

Il valore corretto della ptr, o il valore puntatore nullo se lo spazio disponibile è troppo piccolo.

Original:

The adjusted value of ptr, or null pointer value if the space provided is too small.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Esempio

Vedi anche

alignof operator queries alignment requirements of a type (dal C++11) [modifica]
alignas specificatore

specifica che il deposito per la variabile deve essere allineato (C++11) quantità specifica

Original:

specifies that the storage for the variable should be aligned by specific amount (C++11)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]

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) [modifica]