delete expression
来自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. |
和釋放
Original:
Destructs object(s) previously allocated by the
新的表達</div> and releases obtained memory area
Original:
new expression
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
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.
[编辑] 語法
::(可選的) delete expression
|
(1) | ||||||||
::(可選的) delete [] expression
|
(2) | ||||||||
[编辑] 解釋
銷毀對象,構建
new表達和釋放所獲得的內存區域。 expression導致的new表達的以前調用所返回的指針的值。對於單一的分配對象的第一個版本必須使用的表達,而對數組的第二個版本,必須使用。有沒有刪除的的表達釋放對象初始化「位置」,釋放函數和析構函數必須顯式調用.Original:
Destructs objects, previously constructed by
new expression and releases the obtained memory area. The expression must result in a pointer value that was returned by previous call to the new expression. For single allocated objects the first version of the expression must be used, whereas for arrays the second version must be used. There is no delete expression deallocating objects initialized by placement new, deallocation function and destructor must be explicitly called.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.
該存儲器被釋放釋放函數,要麼operator delete(第一版本的表達)或operator delete[](表達式的第二個版本).
Original:
The memory is deallocated by an 釋放函數, either operator delete (for the first version of the expression) or operator delete[] (for the second version of the expression).
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.
釋放函數的名稱首先在本地類「類型」的範圍抬起頭來,只有當查找失敗,全局命名空間抬起頭來。
::是delete表達,只有全局命名空間抬起頭來。該函數的原型必須看起來像下面這樣:Original:
The deallocation function's name is firstly looked up in the local class type scope and only if the lookup fails, the global namespace is looked up. If
:: is present in the delete expression, only the global namespace is looked up. The prototype of the function must look like the following: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.
| void operator delete (void *ptr); |
for the first version | |
| void operator delete[](void *ptr); |
for the second version | |
這兩個函數隱式聲明每個翻譯單元。此外,隱式實現由編譯器在默認情況下,除非程序顯式實現。有關更多信息,請參見這一點.
Original:
Both these functions are implicitly declared in each translation unit. Also, implicit implementations are provided by the compiler by default, unless the program has explicitly implemented them. See 這一點 for more information.
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.

