<div class="t-tr-text">operador<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> delete<div class="t-tr-text">, Operador<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> delete[]
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <new>
|
||
| void operator delete ( void* ptr ); |
(1) | |
| void operator delete[]( void* ptr ); |
(2) | |
| void operator delete ( void* ptr, const std::nothrow_t& ); |
(3) | |
| void operator delete[]( void* ptr, const std::nothrow_t& ); |
(4) | |
| void operator delete ( void* ptr, void*); |
(5) | |
| void operator delete[]( void* ptr, void* ); |
(6) | |
Desasigna almacenamiento. Estas funciones de asignación son llamados por Eliminar-expresiones para liberar memoria después destruyendo objetos dinámicos .
1) Original:
Deallocates storage. These allocation functions are called by Eliminar-expresiones to deallocate memory after destructing dynamic objects.
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.
Desasigna almacenamiento, que se obtiene mediante una llamada a operator new(size_t) o operator new(size_t, std::nothrow_t)
2) Original:
Deallocates storage, obtained by a call to operator new(size_t) or operator new(size_t, std::nothrow_t)
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.
Desasigna almacenamiento, que se obtiene mediante una llamada a operator new[](size_t) o operator new[](size_t, std::nothrow_t)
3-4) Original:
Deallocates storage, obtained by a call to operator new[](size_t) or operator new[](size_t, std::nothrow_t)
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.
Igual 1-2) a menos que sustituye. Estas versiones son llamados por no lanza nuevas expresiones-si un constructor que llaman produce una excepción .
5-6) Original:
Same as 1-2) unless replaced. These versions are called by non-throwing new-expressions if a constructor they call throws an exception.
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.
No hacer nada. Estas versiones son llamados por la colocación de nuevas expresiones si un constructor que llaman produce una excepción .
Original:
Do nothing. These versions are called by placement new expressions if a constructor they call throws an exception.
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.
En todos los casos, si
ptr es un puntero nulo, la función de cancelación de asignación no hace nada .Original:
In all cases, if
ptr is a null pointer, the deallocation function does nothing.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.
Contenido |
[editar] Sustitución y sobrecarga
Las versiones 1-4) se declara implícitamente en cada unidad de traducción, incluso si el encabezado
<new> no está incluido. Estas funciones son reemplazables': proporcionado por el usuario no miembro de función con la misma firma que sustituye a la versión implícita. A lo sumo una sustitución puede ser proporcionado para cada una de las cuatro funciones de desasignación implícitos. Además, el programa puede definir versiones de miembro de clase de estas funciones o definir funciones de asignación con firmas diferentes (excepto 5-6) no son reemplazables) .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 deallocation functions. Also, program can define class member versions of these functions or define allocation functions with different signatures (except 5-6) are not replaceable).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.
La función de cancelación de la asignación se puede sustituir / sobrecargado de dos maneras:
Original:
The deallocation 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.
You can help to correct and verify the translation. Click here for instructions.
- 'En el ámbito global': para llamarlo, la firma de las funciones de asignación sobrecargado debe ser visible en el lugar de desafectación, excepto implícitamente declaradas funciones predeterminadas desasignación. Esta función de asignación se utiliza para todas las cancelaciones de asignación con los parámetros correspondientes en el programa actualOriginal:in the global scope: in order to call it, the signature of the overloaded allocation functions must be visible at the place of deallocation, except for implicitly declared default deallocation functions. This allocation function will be used for all deallocations with corresponding parameters in the current programThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 'En el ámbito local': el
operator deletesobrecargado debe ser miembro público static function de la clase. Esta función desasignación se utilizará sólo para cancelaciones de asignación de esa clase particular .Original:in the local scope: the overloadedoperator deletemust be static public member function of the class. This deallocation function will be used only for deallocations 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 compilación, cada expresión
delete mira el nombre de la función de cancelación de asignación que sean procedentes en primer lugar en el ámbito de la clase y después de que en el ámbito global. Puede ser instruidos para saltarse el primer paso. Tenga en cuenta, que según sobrecarga de reglas, las funciones desasignación declarados en el ámbito de clase oculta todas las funciones desasignación globales. Para obtener más información suprimir la expresión ver .Original:
During compilation, each
delete expression looks up for appropriate deallocation function's name firstly in the class scope and after that in the global scope. It can be instructed to skip the first step. Note, that as per sobrecarga de reglas, any deallocation functions declared in class scope hides all global deallocation functions. For more information see suprimir la expresión.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.
[editar] Parámetros
| ptr | - | puntero a un área de memoria para desasignar o un puntero nulo
Original: pointer to a memory area to deallocate or a null pointer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Valor de retorno
(Ninguno)
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.
[editar] Excepciones
[editar] Ver también
[editar] Ver también
| funciones de asignación 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. (función) | |
| versiones sin inicializar el almacenamiento Original: releases uninitialized storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
| desasigna memoria Original: deallocates memory The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |