<div class="t-tr-text">operatore<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">operator</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> new<div class="t-tr-text">, Operatore<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">, operator</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> new[]

Da cppreference.com.
< cpp‎ | memory‎ | new

 
 
Utilità libreria
Tipo di supporto (basic types, RTTI, type traits)
Gestione della memoria dinamica
La gestione degli errori
Programma di utilità
Funzioni variadic
Data e ora
Funzione oggetti
initializer_list(C++11)
bitset
hash(C++11)
Gli operatori relazionali
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Coppie e tuple
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Swap, in avanti e spostare
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
Gestione della memoria dinamica
Basso livello di gestione della memoria
Allocatori
Original:
Allocators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
allocator
allocator_traits(C++11)
allocator_arg_t(C++11)
allocator_arg(C++11)
uses_allocator(C++11)
scoped_allocator_adaptor(C++11)
Non inizializzata stoccaggio
Original:
Uninitialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uninitialized_copy
uninitialized_copy_n(C++11)
uninitialized_fill
uninitialized_fill_n
raw_storage_iterator
get_temporary_buffer
return_temporary_buffer
Puntatori intelligenti
Original:
Smart pointers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unique_ptr(C++11)
shared_ptr(C++11)
weak_ptr(C++11)
auto_ptr(deprecato)
owner_less(C++11)
enable_shared_from_this(C++11)
bad_weak_ptr(C++11)
default_delete(C++11)
Garbage collection supporto
Original:
Garbage collection support
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declare_reachable(C++11)
undeclare_reachable(C++11)
declare_no_pointers(C++11)
undeclare_no_pointers(C++11)
pointer_safety(C++11)
get_pointer_safety(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.
pointer_traits(C++11)
addressof(C++11)
align(C++11)
C Library
Original:
C Library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Basso livello di gestione della memoria
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.
operator new
operator new[]
operator delete
operator delete[]
get_new_handler(C++11)
set_new_handler
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.
bad_alloc
bad_array_new_length(C++11)
nothrow_t
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.
new_handler
Oggetti
Original:
Objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
nothrow
 
Elemento definito nell'header <new>
void* operator new  (std::size_t count );
(1)
void* operator new[](std::size_t count );
(2)
void* operator new  (std::size_t count, conststd::nothrow_t&);
(3)
void* operator new[](std::size_t count, conststd::nothrow_t&);
(4)
void* operator new  (std::size_t, void* ptr );
(5)
void* operator new[](std::size_t, void* ptr );
(6)
Alloca ha chiesto il numero di byte. Queste funzioni di allocazione vengono chiamati da nuove-espressioni di allocare memoria nella quale nuovo oggetto sarebbe poi essere inizializzato.
Original:
Allocates requested number of bytes. These allocation functions are called by nuove-espressioni to allocate memory in which new object would then be initialized.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1-2)
Assegna count byte di memoria libera. Chiama il puntatore a funzione restituito da std::get_new_handler in caso di fallimento e si ripete fino a quando i tentativi di assegnazione nuovo gestore non restituisce o diventa un puntatore nullo, momento in cui getta std::bad_alloc.
Original:
Allocates count bytes from free store. Calls the function pointer returned by std::get_new_handler on failure and repeats allocation attempts until new handler does not return or becomes a null pointer, at which time throws std::bad_alloc.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3-4)
Uguale a 1-2, ma restituisce un puntatore nullo quando 1-2 sarebbe std::bad_alloc tiro
Original:
Same as 1-2, but returns a null pointer when 1-2 would throw std::bad_alloc
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5-6)
non fa nulla, ptr rendimenti. Queste versioni sono chiamati dalla nuova espressione che costruire oggetti in deposito assegnato in precedenza.
Original:
does nothing, returns ptr. These versions are called by new-expression which construct objects in previously allocated storage.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica]Sostituzione e sovraccarico

Le versioni 1-4) sono implicitamente dichiarate in ogni unità di traduzione, anche se l'intestazione <new> non è incluso. Queste funzioni sono' sostituibili: un utente fornito non funzione membro con la stessa firma sostituisce la versione implicita. Al più una sostituzione possono essere forniti per ciascuna delle quattro funzioni di allocazione implicite. Inoltre, il programma può definire versioni membro di classe di queste funzioni o definire le funzioni di assegnazione con firme diverse (con la differenza che non è consentito sostituire (5-6) versioni della funzione di allocazione). La firma ha aggiunto dovrebbe essere simile al seguente, dove count è il numero di byte da allocare e placement_params' sono i parametri forniti per l'espressione new:
Original:
The versions 1-4) are implicitly declared in each translation unit even if the <new> header is not included. These functions are replaceable: a user-provided non-member function with the same signature replaces the implicit version. At most one replacement may be provided for each of the four implicit allocation functions. Also, program can define class member versions of these functions or define allocation functions with different signatures (except that it is not permitted to replace (5-6) versions of the allocation function). The added signature should look like the following, where count is number of bytes to allocate and placement_params are the parameters supplied to the new expression:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
void* operator new  (size_t count/*, placement_params*/);
for the new version
void* operator new[](size_t count/*, placement_params*/);
for the new[] version
La funzione di assegnazione può essere sostituito / sovraccarico in due modi:
Original:
The allocation function can be replaced/overloaded in two ways:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
'In ambito globale': per chiamarlo, la firma delle funzioni di allocazione di overload deve essere visibile nel luogo di assegnazione, fatta eccezione per le funzioni di default implicitamente dichiarate di allocazione. Questa funzione assegnazione viene utilizzata per tutte le allocazioni con parametri corrispondenti nel programma corrente
Original:
in the global scope: in order to call it, the signature of the overloaded allocation functions must be visible at the place of allocation, except for implicitly declared default allocation functions. This allocation function will be used for all allocations with corresponding parameters in the current program
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
'Nello scope locale': il operator new sovraccarico deve essere statico funzione membro pubblico della classe. Questa funzione assegnazione viene utilizzata solo per le assegnazioni di quella particolare classe.
Original:
in the local scope: the overloaded operator new must be static public member function of the class. This allocation function will be used only for allocations of that particular class.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Durante la compilazione, ogni espressione new cerca per nome di funzione adeguata dotazione di in primo luogo nel campo di applicazione di classe e dopo che in ambito globale. Che può essere usato per saltare il primo passo chiamando new come ::new. Si noti che secondo sovraccarico regole, le funzioni di allocazione dichiarato nell'ambito della classe nasconde tutte le funzioni di allocazione globale. Per ulteriori informazioni, vedere NJ espressione. Nota, che non è possibile mettere in funzione di assegnazione di un namespace.
Original:
During compilation, each new expression looks up for appropriate allocation function's name firstly in the class scope and after that in the global scope. It can be instructed to skip the first step by calling new as ::new. Note, that as per sovraccarico regole, any allocation functions declared in class scope hides all global allocation functions. For more information see NJ espressione. Note, that it is not possible to place allocation function in a namespace.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Parametri

count -
numero di byte da allocare
Original:
number of bytes to allocate
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ptr -
puntatore ad un'area di memoria per inizializzare l'oggetto
Original:
pointer to a memory area to initialize the object at
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

1-4)
puntatore alla zona di memoria allocata
Original:
pointer to allocated memory area
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

5-6) ptr

[modifica]Eccezioni

1-2)
getta std::bad_alloc in caso di fallimento di allocare memoria
Original:
throws std::bad_alloc on failure to allocate memory
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3-6)
noexcept specification:  
noexcept
  (dal C++11)

[modifica]Vedi anche

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

(funzione)[modifica]
ottiene il gestore nuova corrente
Original:
obtains the current new handler
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione)[modifica]
registra un nuovo gestore
Original:
registers a new handler
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione)[modifica]
ottiene stoccaggio non inizializzata
Original:
obtains uninitialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione)
alloca memoria
Original:
allocates memory
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione)
close