std::atomic::fetch_add
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. |
<metanoindex/>
<tbody> </tbody> T fetch_add( T arg, memory_order = std::memory_order_seq_cst ); T fetch_add( T arg, memory_order = std::memory_order_seq_cst ) volatile; |
(unico membro del modello di specializzazione atomic<Integral>)(dal C++11) |
|
T* fetch_add( std::ptrdiff_t arg, memory_order = std::memory_order_seq_cst ); T* fetch_add( std::ptrdiff_t arg, memory_order = std::memory_order_seq_cst ) volatile; |
(unico membro del modello di specializzazione atomic<T*>)(dal C++11) |
|
Atomicamente sostituisce il valore corrente con il risultato della somma aritmetica del valore e
arg. L'operazione è lettura-modifica-scrittura. Memoria è influenzata in base al valore di memory_order.Original:
Atomically replaces the current value with the result of arithmetic addition of the value and
arg. The operation is read-modify-write operation. Memory is affected according to the value of memory_order.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.
Per i tipi di
Integral firmati, l'aritmetica è definito l'utilizzo di due rappresentazione in complemento. EccoOriginal:
For signed
Integral types, arithmetic is defined to use two’s complement representation. ThereThe 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.
sono risultati non definiti. Per i tipi
T*, il risultato può essere un indirizzo definito, ma le operazioni altrimenti non hanno un comportamento indefinito.Original:
are no undefined results. For
T* types, the result may be an undefined address, but the operations otherwise have no undefined behavior.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.
Parametri
| arg | - | l'altro argomento di somma aritmetica
Original: the other argument of arithmetic addition The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| memory_order | - | vincoli di ordine di memoria da far rispettare
Original: memory order constraints to enforce 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 della variabile atomica prima della chiamata.
Original:
The value of the atomic variable before the call.
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.
Eccezioni
Vedi anche
(C++11) (C++11) |
aggiunge un non-atomico valore a un oggetto atomico e ottiene il valore precedente della atomico Original: adds a non-atomic value to an atomic object and obtains the previous value of the atomic The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) |