std::allocator_traits::construct
Da cppreference.com.
< cpp | memory | allocator traits
![]() | 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 <memory> | ||
template<class T, class... Args> staticvoid construct( Alloc& a, T* p, Args&&... args); | (dal C++11) | |
Se possibile, costruisce un oggetto di tipo
T
in memoria non inizializzata assegnato puntato da p
, chiamandoOriginal:
If possible, constructs an object of type
T
in allocated uninitialized storage pointed to by p
, by callingThe 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.
a.construct(p, std::forward<Args>(args)...)
Se quanto sopra non è possibile (ad esempio
a
non ha la funzione di membro construct()
,), quindi chiama posizionamento nuovoOriginal:
If the above is not possible (e.g.
a
does not have the member function construct()
,), then calls placement-new asThe 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.
::new(static_cast<void*>(p)) T(std::forward<Args>(args)...)
Indice |
[modifica]Parametri
a | - | allocatore di utilizzare per la costruzione Original: allocator to use for construction The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
args... | - | gli argomenti da passare al costruttore a.construct() o per posizionamento nuovo Original: the constructor arguments to pass to a.construct() or to placement-new The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifica]Valore di ritorno
(Nessuno)
Original:
(none)
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.
[modifica]Note
Questa funzione viene utilizzata dai contenitori della libreria standard quando si inserisce, la copia, o elementi in movimento.
Original:
This function is used by the standard library containers when inserting, copying, or moving elements.
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.
Poiché questa funzione fornisce la caduta automatico verso il nuovo posizionamento, la
construct()
funzione membro è un requisito Allocator
opzionale visto che il C + 11.Original:
Because this function provides the automatic fall back to placement new, the member function
construct()
is an optional Allocator
requirement since C++11.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.
[modifica]Vedi anche
allocazione funzioni Original: allocation functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
costruisce un oggetto nella memoria allocata Original: constructs an object in allocated storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |